title: define jpa entity classes outside of persistence.xml
body: <p>Is there a way to define jpa entity classes outside of persistence.xml (i.e. in a separate file)?</p>
  
  <p>Being able to not have persistence.xml as an external file would also suffice.</p>
  
  <p>Thanks in advance,
  Steven</p>
  
  <p>Edit:
  Sorry I was not clear. This is in a Java SE environment.
  Also, I would like to not have a listing of some.class.AClass in my persistence.xml file.
  This is because I would like to create this list of classes dynamically and reference a file containing this list.</p>
  
  <p>Edit2:
  Managed to solve this by writing a persistence.xml file at build time before it is packaged. If anyone is interested, I used scannotations to discover all the classes annotated with @Entity and wrote them to the persistence.xml file in target/classes/META-INF (using maven).</p>