Hi, I am evaluating ObjectDB by using it with an in-house developed library in order to prototype its capabilities / performance.
I am having a problem in that the in-house library in question reads a simple configuration file to determine available persistence units, and then bootstraps them using the JPA Persistance.createEntityManagerFactory() method and passing in the persistence unit name (again, obtained from the configuration file ).
After the entity manager factory is obtained, the Metamodel is empty - none of the entities referenced in the mapping file are present in the Metamodel.
here is my persistence.xml
<?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name="project.odb" > <mapping-file>mil/navy/navo/arf/config/orm.xml</mapping-file> <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <property name="javax.persistence.jdbc.url" value="objectdb://localhost:6136/project.odb" /> <property name="javax.persistence.jdbc.user" value="admin"/> <property name="javax.persistence.jdbc.password" value="admin" /> </properties> </persistence-unit> </persistence>
The entities are mapped in the ORM.xml file correctly, as they work with the previous hibernate implementation.
the java code that interacts with the Persistence api:
EntityManagerFactory emf = Persistence.createEntitManagerFactory("project.odb"); //this set is alwasy empty with ObjectDB Set<EntityType> managedEntities = emf.getMetaModel().getEntities();
I am certain that this must be a configuration issue, although I am using the default configuration file with no changes.