hibernate注解生成数据库表,但是某些表能生成,某些表生成不了??
@SuppressWarnings("serial")@Entity@Table(name="ge_company")publicclassCompanyextendsB...
@SuppressWarnings("serial")
@Entity
@Table(name = "ge_company")
public class Company extends BaseEntity {
public String no;
public String name;
public String shortName;
public String type;
public Date foundDate;
public String phoneNumber;
public String fax;
public String email;
public String mail;
public String code;
public String website;
public Date writeTime;
public String memo;
public Set<Department> departments;
能生成
下面这个就生成不了
@SuppressWarnings("serial")
@Entity
@Table(name = "ge_department")
public class Department extends BaseEntity {
public String companyName;
public String no;
public String name;
public int level;
public String manager;
public boolean independent;
public String desc;
public String upguid;
public boolean close;
public Date writeTime;
public String memo;
public Company company; 展开
@Entity
@Table(name = "ge_company")
public class Company extends BaseEntity {
public String no;
public String name;
public String shortName;
public String type;
public Date foundDate;
public String phoneNumber;
public String fax;
public String email;
public String mail;
public String code;
public String website;
public Date writeTime;
public String memo;
public Set<Department> departments;
能生成
下面这个就生成不了
@SuppressWarnings("serial")
@Entity
@Table(name = "ge_department")
public class Department extends BaseEntity {
public String companyName;
public String no;
public String name;
public int level;
public String manager;
public boolean independent;
public String desc;
public String upguid;
public boolean close;
public Date writeTime;
public String memo;
public Company company; 展开
展开全部
表没设置主键哦 违反三范式不能生成
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
相互依赖,死循环了吧?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-05-15
展开全部
可能是没有设置主键的问题把
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询