我使用@ElementCollection自定義對象列表JPA @Embeddable
@ElementCollection
@CollectionTable(name = "choice", joinColumns = @JoinColumn(name = "itemId"))
@OrderColumn(name = "index")
private List<Choice> choices = new ArrayList<Choice>();
我創建了這樣的
//@Embeddable
@Table(name = "choice")
@Cacheable(false)
@Audited
public class Choice implements Serializable{
一個Choice類如果我使用@Embeddable批註我越來越org.hibernate.MappingException: Type not supported for auditing: org.hibernate.type.ComponentType
我是JPA的新手。有什麼我失蹤?
你不瞭解什麼?該消息非常明確:您無法審覈組件/可嵌入。讓它成爲一個真正的實體。 –