I have my entities splitted among different jar-files and I am also using a mix of annotations and a mapping file.
Lets say I have a jar file x.jar and root.jar, where root.jar contains the orm.xml file and is dependend on x.jar. The mapping file orm.xml defines additional entities which are both located in x.jar and root.jar.
My persistence.xml is this (located in root.jar):
... <persistence-unit name="pu"> <jta-data-source>java:/restDS</jta-data-source> <jar-file>x.jar</jar-file> <properties> ... </properties> </persistence-unit> ...
Use of @OneToMany or @ManyToMany targeting an unmapped class