Closed pires closed 10 years ago
By the way, IIRC the JPA spec defines that <excluded-unlisted-classes>
is true by default.
This is a non-issue since I was lacking an entity ID (@Id
annotation).
Nonetheless, I would suggest to improve the exception handling so that instead of having:
java.lang.NullPointerException
at com.impetus.kundera.configure.MetamodelConfiguration.processGeneratedValueAnnotation(MetamodelConfiguration.java:490)
at com.impetus.kundera.configure.MetamodelConfiguration.scanClassAndPutMetadata(MetamodelConfiguration.java:399)
at com.impetus.kundera.configure.MetamodelConfiguration.loadEntityMetadata(MetamodelConfiguration.java:230)
at com.impetus.kundera.configure.MetamodelConfiguration.configure(MetamodelConfiguration.java:102)
at com.impetus.kundera.configure.Configurator.configure(Configurator.java:65)
at com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:109)
at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:81)
at com.impetus.kundera.KunderaPersistence.createContainerEntityManagerFactory(KunderaPersistence.java:65)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)
at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
One should see something like:
com.impetus.kundera.exception.MissingIdField
Thanks to @mevivs for helping with debugging.
I have a polyglot app that has two persistence-units, one with Hibernate as persistence provider, the other with Kundera 2.7.1 (kundera-cassandra).
Now, I have a single persistence.xml that looks like this:
Now, when deploying the app Hibernate works as expected. It validates current PostgreSQL schema and updates if needed. Needless is to say that it also ignores every class, except
UserRDBMS
. The same doesn't happen with Kundera that tries to deal with the aforementioned class when it should deal only withUserNoSQL
entity.Any hints?