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