请教高手CompanyCustomer从Customer继承,但是启动tomcat6的时候出现Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer],不知道是怎么回事?多谢
Customer.java@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(
name="discriminator",
discriminatorType=DiscriminatorType.STRING
)
@DiscriminatorValue("customer")
public class Customer {
private int id;
private Customer parent; public String getCategory(){
return "未知";
} @Id
@GeneratedValue
public int getId() {
return id;
} public void setId(int id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name="pid")
public Customer getParent() {
return parent;
} public void setParent(Customer parent) {
this.parent = parent;
}
}CompanyCustomer.java
@Entity
@DiscriminatorValue("company")
public class CompanyCustomer extends Customer {
//人员规模
private String employeeSize;
@Column(insertable=false,updatable=false)
public String getCategory(){
return "公司";
}
public String getEmployeeSize() {
return employeeSize;
} public void setEmployeeSize(String employeeSize) {
this.employeeSize = employeeSize;
}
}
Error creating bean with name 'sessionFactory' defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
Caused by: java.lang.reflect.InvocationTargetException
Caused by: org.hibernate.PropertyNotFoundException: Could not find a setter for property category in class com.wdl.crm.model.PersonalCustomer不写这一句@Column(insertable=false,updatable=false)
则会出现重复映射的问题,不知道怎么解决,找了一天都没找到问题出在哪里,和没有setCategory方法没关系,因为我在父类和子类把getCategory方法都去掉也报同样的错误
Customer.java@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(
name="discriminator",
discriminatorType=DiscriminatorType.STRING
)
@DiscriminatorValue("customer")
public class Customer {
private int id;
private Customer parent; public String getCategory(){
return "未知";
} @Id
@GeneratedValue
public int getId() {
return id;
} public void setId(int id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name="pid")
public Customer getParent() {
return parent;
} public void setParent(Customer parent) {
this.parent = parent;
}
}CompanyCustomer.java
@Entity
@DiscriminatorValue("company")
public class CompanyCustomer extends Customer {
//人员规模
private String employeeSize;
@Column(insertable=false,updatable=false)
public String getCategory(){
return "公司";
}
public String getEmployeeSize() {
return employeeSize;
} public void setEmployeeSize(String employeeSize) {
this.employeeSize = employeeSize;
}
}
Error creating bean with name 'sessionFactory' defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
Caused by: java.lang.reflect.InvocationTargetException
Caused by: org.hibernate.PropertyNotFoundException: Could not find a setter for property category in class com.wdl.crm.model.PersonalCustomer不写这一句@Column(insertable=false,updatable=false)
则会出现重复映射的问题,不知道怎么解决,找了一天都没找到问题出在哪里,和没有setCategory方法没关系,因为我在父类和子类把getCategory方法都去掉也报同样的错误
解决方案 »
- weblogic9.1 configuration Wizard 无法启动
- java设置sqlserver2005精度
- @GeneratedValue(generator=?)后面应该怎么写?
- 大虾帮忙:struts中如何设计有未知个数的属性的表单?
- 以前做的STRUTS入门SAMPLE(通过运行)今天运行有错误了...
- 将一个普通的文件比如txt文件加入一个已经存在的压缩文件里
- j2ee配置问题,很简单,快给我整疯了帮帮忙
- 问:我用formulaOne设计器,生成的test.jod,怎么应用到jsp中呀?
- 如何跨越代理使用javamail?
- SessionBean在事务里不会超时的吗?
- maven Missing artifact 异常
- 求助!Struts2和Extjs整合的问题
建议换一种继承方式吧