ids for this class must be manually assigned before calling save

org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save()

ID生成定义错了,
或者继承的类有问题

解决:
修改ID定义处:
@Entity
public class Employee implements Serializable {
    ...
@Id
@SequenceGenerator(name="CUST_SEQ", allocationSize=25)
@GeneratedValue(strategy=SEQUENCE, generator="CUST_SEQ")
@Column(name="CUST_ID")
public Long getId() {
return id;
    }
    ...
如果还有问题,则去掉继承试一下.

你可能感兴趣的:(Hibernate)