users@glassfish.java.net

Re: Including a persistence archive in an EJB module

From: Cheng Fang <Cheng.Fang_at_Sun.COM>
Date: Wed, 24 Oct 2007 10:34:23 -0400

The easiest way is to package your entity classes directly inside
ejb-jar. See the following structure. <jar-file> element is typically
used to reference jar files inside the EAR, not ejb-jar. See JPA spec
Chapter 6 Entity Packaging for more details (jcp.org JSR 220)

jar tvf foo-ejb.jar:

META-INF/
META-INF/MANIFEST.MF
META-INF/persistence.xml
META-INF/ejb-jar.xml
com/foo/ejb30/XBean.class
com/foo/entities/A.class
com/foo/entities/B.class

-cheng