I would like to package some entity classes into a jar that also contains a mapping file. The structure is this:
Code:
*****
claimStatus.jar
com
fs
ClaimStatus.class
META-INF
orm.xml
*****
I have tried to include this in another application and can not seem to get it to work correctly. The jar is placed in the lib directory of the application.
Code:
*****
myApp
com
...
lib
claimStatus.jar
...
META-INF
persistence.xml
*****
If I add the "<jar-file>lib/claimStatus.jar</jar-file>" element to the persistence.xml file, I get an error that it can't find the NamedQuery (defined in the orm.xml file). Shouldn't it be found automatically?
If I add "<mapping-file>META-INF/orm.xml</mapping-file>" (no <jar-file> element), it seems to work.
Can somebody explain why file is ignored(?) if I use the "<jar-file>" element? I thought this was the correct way to do this.
Actually, any info on this subject would be helpful.
ldl