I am using @ElementCollection for a custom object list
@ElementCollection
@CollectionTable(name = "choice", joinColumns = @JoinColumn(name = "itemId"))
@OrderColumn(name = "index")
private List<Choice> choices = new ArrayList<Choice>();
I have created a Choice class like this
//@Embeddable
@Table(name = "choice")
@Cacheable(false)
@Audited
public class Choice implements Serializable{
If I use @Embeddable annotation I am getting org.hibernate.MappingException: Type not supported for auditing: org.hibernate.type.ComponentType
I am new to JPA. Is there anything that I am missing?
If you want to use @Embeddable
, the field that refers to the @Embeddable
class needs to have the @Embedded
annotation. Then, the fields in the @Embedded
class need to have proper JPA annotations so JPA knows what to do with them. You may want to read this in order to fully understand what @Embbedable
does.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With