public class JPAGenerator extends Object
| Modifier and Type | Field and Description |
|---|---|
static Class<?>[] |
abstractInterchangeable
List of abstract AAF classes that are part of the interchangeable
object hierarchy, i.e.
|
static Class<?>[] |
interchangeable
List of concrete AAF classes that are interchangeable as they extend
InterchangeObject. |
| Constructor and Description |
|---|
JPAGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
generateORM(Collection<Class<? extends MediaEntity>> mediaClassList,
String fileName)
Generate an object relational mapping
Java Persistence API 2.0
configuration file (
orm.xml) from the given collection of classes and store
it in the given file. |
static void |
main(String[] args) |
public static final Class<?>[] interchangeable
List of concrete AAF classes that are interchangeable as they extend
InterchangeObject.
public static final Class<?>[] abstractInterchangeable
List of abstract AAF classes that are part of the interchangeable
object hierarchy, i.e. abstract and extending InterchangeObject.
public static final boolean generateORM(Collection<Class<? extends MediaEntity>> mediaClassList, String fileName) throws NullPointerException, IllegalArgumentException
Generate an object relational mapping
Java Persistence API 2.0
configuration file (orm.xml) from the given collection of classes and store
it in the given file. Any embeddable objects or other utility class mappings will be
included in the mapping if they are required.
The mapping file allows the given media entities to be persisted to a relational database using a JPA implementation, such as Open JPA or Hibernate. By using this method, a developer only needs to use one set of annotations to turn a class into both:
Another benefit of using media annotations rather than JPA annotations is that this code base can be compiled in Java SE without the need for JPA libraries to be present.
mediaClassList - Collection of classes to create object relational mappings for.fileName - Name and path of the object relational mapping file to create.NullPointerException - Cannot generate an object relational mapping if any
of the input values or classes is null.IllegalArgumentException - One or more of the given classes is not
annotated as a media class.(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.