IllegalArgumentException occurred while calling setter of com.entity.CmpShowmesf

J2EE 码拜 9年前 (2015-04-19) 901次浏览 0个评论
 

CmpShowmesfirst:
package com.entity;

import java.math.BigDecimal;

/**
 * CmpShowmesfirst entity. @author MyEclipse Persistence Tools
 */

public class CmpShowmesfirst implements java.io.Serializable {

// Fields

private BigDecimal csfId;
private String csfTitle;
private String csfContent;
private BigDecimal csfPicid;
public BigDecimal getCsfId() {
return csfId;
}
public void setCsfId(BigDecimal csfId) {
this.csfId = csfId;
}
public String getCsfTitle() {
return csfTitle;
}
public void setCsfTitle(String csfTitle) {
this.csfTitle = csfTitle;
}
public String getCsfContent() {
return csfContent;
}
public void setCsfContent(String csfContent) {
this.csfContent = csfContent;
}
public BigDecimal getCsfPicid() {
return csfPicid;
}
public void setCsfPicid(BigDecimal csfPicid) {
this.csfPicid = csfPicid;
}
public BigDecimal getCsfTypeid() {
return csfTypeid;
}
public void setCsfTypeid(BigDecimal csfTypeid) {
this.csfTypeid = csfTypeid;
}
public CmpSmfPic getCmpsmfpic() {
return cmpsmfpic;
}
public void setCmpsmfpic(CmpSmfPic cmpsmfpic) {
this.cmpsmfpic = cmpsmfpic;
}
private BigDecimal csfTypeid;
public CmpShowmesfirst(BigDecimal csfId, String csfTitle,
String csfContent, BigDecimal csfPicid, BigDecimal csfTypeid,
CmpSmfPic cmpsmfpic) {
super();
this.csfId = csfId;
this.csfTitle = csfTitle;
this.csfContent = csfContent;
this.csfPicid = csfPicid;
this.csfTypeid = csfTypeid;
this.cmpsmfpic = cmpsmfpic;
}
public CmpShowmesfirst() {
super();
}
private CmpSmfPic cmpsmfpic;

// Constructors
}

CmpSmfPic:
package com.entity;

import java.math.BigDecimal;

/**
 * CmpSmfPic entity. @author MyEclipse Persistence Tools
 */

public class CmpSmfPic implements java.io.Serializable {

// Fields

private BigDecimal cspId;
private BigDecimal cspCsfid;
private String cspPic;

// Constructors

/** default constructor */
public CmpSmfPic() {
}

/** full constructor */
public CmpSmfPic(BigDecimal cspCsfid, String cspPic) {
this.cspCsfid = cspCsfid;
this.cspPic = cspPic;
}

// Property accessors

public BigDecimal getCspId() {
return this.cspId;
}

public void setCspId(BigDecimal cspId) {
this.cspId = cspId;
}

public BigDecimal getCspCsfid() {
return this.cspCsfid;
}

public void setCspCsfid(BigDecimal cspCsfid) {
this.cspCsfid = cspCsfid;
}

public String getCspPic() {
return this.cspPic;
}

public void setCspPic(String cspPic) {
this.cspPic = cspPic;
}

}
CmpShowmesfirst.hbm.xml:

<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE hibernate-mapping PUBLIC “-//Hibernate/Hibernate Mapping DTD 3.0//EN”
“http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd”>
<!– 
    Mapping file autogenerated by MyEclipse Persistence Tools
–>
<hibernate-mapping>
    <class name=”com.entity.CmpShowmesfirst” table=”CMP_SHOWMESFIRST” schema=”CMS_SYSTEM”>
        <id name=”csfId” type=”java.math.BigDecimal”>
            <column name=”CSF_ID” precision=”22″ scale=”0″ />
            <generator class=”sequence” />
        </id>
        <property name=”csfTitle” type=”java.lang.String”>
            <column name=”CSF_TITLE” length=”40″ />
        </property>
        <property name=”csfContent” type=”java.lang.String”>
            <column name=”CSF_CONTENT” length=”0″ />
        </property>
        <property name=”csfPicid” type=”java.math.BigDecimal”>
            <column name=”CSF_PICID” precision=”22″ scale=”0″ />
        </property>
        <property name=”csfTypeid” type=”java.math.BigDecimal”>
            <column name=”CSF_TYPEID” precision=”22″ scale=”0″ />
        </property>
        <set name=”cmpsmfpic” cascade=”all”>
         <key column=”CSP_CSFID”/>
         <one-to-many class=”com.entity.CmpSmfPic”/>
        </set>
    </class>
</hibernate-mapping>

CmpSmfPic.hbm.xml:
<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE hibernate-mapping PUBLIC “-//Hibernate/Hibernate Mapping DTD 3.0//EN”
“http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd”>
<!– 
    Mapping file autogenerated by MyEclipse Persistence Tools
–>
<hibernate-mapping>
    <class name=”com.entity.CmpSmfPic” table=”CMP_SMF_PIC” schema=”CMS_SYSTEM”>
        <id name=”cspId” type=”java.math.BigDecimal”>
            <column name=”CSP_ID” precision=”22″ scale=”0″ />
            <generator class=”sequence” />
        </id>
        <property name=”cspCsfid” type=”java.math.BigDecimal”>
            <column name=”CSP_CSFID” precision=”22″ scale=”0″ />
        </property>
        <property name=”cspPic” type=”java.lang.String”>
            <column name=”CSP_PIC” length=”100″ />
        </property>
        <many-to-one name=”cmpshowmesfirst” class=”com.entity.CmpSmfPic” cascade=”all”>
         <column name=”CSP_CSFID”/>
        </many-to-one>
    </class>
</hibernate-mapping>

IllegalArgumentException occurred while calling setter of com.entity.CmpShowmesf
10分
com.entity.CmpShowmesf

你的题目是这个类的,不过我没找到你所的这个类

IllegalArgumentException occurred while calling setter of 就是隐射问题

你查看下你那个entity的Hibernate映射的时候类型和你Setter方法类型是否一致

PS:以后问问题 写清楚点啊。

IllegalArgumentException occurred while calling setter of com.entity.CmpShowmesf
10分
IllegalArgumentException

这个异常是非法参数异常

IllegalArgumentException occurred while calling setter of com.entity.CmpShowmesf
是dao类返回的不够明确 ,我已经解决了,谢谢。
IllegalArgumentException occurred while calling setter of com.entity.CmpShowmesf
你好,我也出现了类似这样的错误nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.firedance.XX
查了好几遍实体类和映射文件,还是没看出来问题。你说的这个解决方法到底是在哪儿呢?多多指教
IllegalArgumentException occurred while calling setter of com.entity.CmpShowmesf
怎么解决的公布出来啊!楼猪~~

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明IllegalArgumentException occurred while calling setter of com.entity.CmpShowmesf
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!