目标表字段:
scheduletypeid typename typeparentid
1 java 0
2 javaEE 1
3 javaME 1
4 .net 0
5 C# 4
6 asp.net 4
@Entity
@Table(name = "ws_scheduletype")
public class ScheduleType implements java.io.Serializable{ private static final long serialVersionUID = 1L;
private int scheduletypeid;
private String typeName;
private ScheduleType typeparent; private Set<ScheduleType> typechildren; public ScheduleType() {
super();
} public int getScheduletypeid() {
return scheduletypeid;
} public void setScheduletypeid(int scheduletypeid) {
this.scheduletypeid = scheduletypeid;
} public String getTypeName() {
return typeName;
} public void setTypeName(String typeName) {
this.typeName = typeName;
}
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumns({
@JoinColumn(name = "typeparentid",nullable = false, insertable = true, updatable = true)
})
public ScheduleType getTypeparent() {
return typeparent;
} public void setTypeparent(ScheduleType typeparent) {
this.typeparent = typeparent;
} @OneToMany(cascade = { CascadeType.MERGE }, fetch = FetchType.EAGER, mappedBy = "typeparent")
public Set<ScheduleType> getTypechildren() {
return typechildren;
} public void setTypechildren(Set<ScheduleType> typechildren) {
this.typechildren = typechildren;
}Exception :
Error creating bean with name 'sessionFactory' defined in file [D:\apache-tomcat-6.0.32\wtpwebapps\webvigator\WEB-INF\classes\spring\applicationContext-hibernate-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.company.project.model.ScheduleType
ps: 我有写这个
<property name="packagesToScan">
<list>
<value>com.**.model</value>
</list>
</property>
scheduletypeid typename typeparentid
1 java 0
2 javaEE 1
3 javaME 1
4 .net 0
5 C# 4
6 asp.net 4
@Entity
@Table(name = "ws_scheduletype")
public class ScheduleType implements java.io.Serializable{ private static final long serialVersionUID = 1L;
private int scheduletypeid;
private String typeName;
private ScheduleType typeparent; private Set<ScheduleType> typechildren; public ScheduleType() {
super();
} public int getScheduletypeid() {
return scheduletypeid;
} public void setScheduletypeid(int scheduletypeid) {
this.scheduletypeid = scheduletypeid;
} public String getTypeName() {
return typeName;
} public void setTypeName(String typeName) {
this.typeName = typeName;
}
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumns({
@JoinColumn(name = "typeparentid",nullable = false, insertable = true, updatable = true)
})
public ScheduleType getTypeparent() {
return typeparent;
} public void setTypeparent(ScheduleType typeparent) {
this.typeparent = typeparent;
} @OneToMany(cascade = { CascadeType.MERGE }, fetch = FetchType.EAGER, mappedBy = "typeparent")
public Set<ScheduleType> getTypechildren() {
return typechildren;
} public void setTypechildren(Set<ScheduleType> typechildren) {
this.typechildren = typechildren;
}Exception :
Error creating bean with name 'sessionFactory' defined in file [D:\apache-tomcat-6.0.32\wtpwebapps\webvigator\WEB-INF\classes\spring\applicationContext-hibernate-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.company.project.model.ScheduleType
ps: 我有写这个
<property name="packagesToScan">
<list>
<value>com.**.model</value>
</list>
</property>
解决方案 »
- ServletActionContext.getRequest().getRealPath(savePath)做什么用的
- css颜色为 "#5125df",用java的Color怎么得到呢?
- 随便看看
- 关于request
- 弱弱的问一个关于jsf的问题
- 求助:could not initialize a collection: [cn.com.app.factory.hibernate.Item.storeItems#1001]
- 哎。。。郁闷的问题
- Eclipse中JSP页面乱码问题
- 急求读写XML格式配置文件的java代码
- list集合,做法求解!!!!
- J2EE 神人进,
- Struts2怎么取得Action中传来的实体????
public int getScheduletypeid() {
return scheduletypeid;
}追加@ID注解