Hi, I'm new to OpenJPA (and JPA) and trying to create the entity-mapping XML files (classes are unannotated POJOs) for a simple parent-child database relationship[1] (parent is department, child is employees working at that department) Right now, here's what I have for the mapping files:[2] (classes are here: [3]).

While my TestClass[4] (which accesses just the department table right now) runs fine I'm getting this warning message while running it: "2213 CompanyPU WARN [main] openjpa.Runtime - Fields "employees" are not a default persistent type, and do not have any annotations indicating their persistence strategy. They will be treated as non-persistent. If you intended for these fields to be persistent, be sure to annotate them appropriately. Otherwise annotate them with @Transient."

Google is returning many examples of others with this error, but I'm still not sure what I'm doing wrong. In the department.orm.xml, I can't map "employees" as Transient because it is already mapped as <one-to-many/>, which is AFAICT the right mapping to do. Basically, what do I have to fix my department.orm.xml[2] (or Department.java class[3]) in order to get rid of the above warning message?

Thanks,
Glen


[1] https://github.com/gmazza/blog-samples/blob/master/jpa_and_junit/src/main/config/create-database-derby.sql [2] https://github.com/gmazza/blog-samples/tree/master/jpa_and_junit/src/main/resources/entities [3] https://github.com/gmazza/blog-samples/tree/master/jpa_and_junit/src/main/java/entities [4] https://github.com/gmazza/blog-samples/blob/master/jpa_and_junit/src/main/java/TestClass.java

Reply via email to