1
我试图让这个映射工作休眠,但我得到这个奇怪的异常消息映射例外与CollectionOfElements
Could not determine type for: foo.ProcessUser, at table: ProcessUser_onetimeCodes, for columns: [org.hibernate.mapping.Column(processUser)]
@Entity
public class ProcessUser {
@Setter
private List<OnetimeCodes> onetimeCodes;
@CollectionOfElements
public List<OnetimeCodes> getOnetimeCodes() {
return onetimeCodes;
}
}
@Embeddable
@Data
public class OnetimeCodes {
@Parent
private ProcessUser processUser;
@Column(nullable=false)
@NotEmpty
private String password;
public OnetimeCodes(ProcessUser processUser, String password) {
this.processUser = processUser;
this.password = password;
}
}
任何人能发现什么是错在这里吗? 我有hibernate.hbm2ddl.auto
上create
该框架是愚蠢的。我有同样的问题。我的设置非常复杂(具有多对一关系的复合外键),我从来没有想到它就是这样。不仅框架的代码不好,文档也是如此,因为它永远不会让'@ EmbeddedId'放在getter上。 – tiktak 2015-01-18 00:29:59