Hi all, can anyone tell me is hibernate annotation supported many-to-many in embeddable?
My situations:
Class Diagram:
ERD:
Seems composite-id must using separate "Embeddable" class, so I use the "IdClass" for the original class and put the "ManyToMany" to the embeddable class, but when I passing the annotation, the following exception is thrown:
Code:
Exception in thread "main" java.lang.NullPointerException
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1148)
at org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:1671)
at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1704)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:663)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)