public class PersistenceUnitProcessor
extends java.lang.Object
Constructor and Description |
---|
PersistenceUnitProcessor() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
buildClassNameFromEntryString(java.lang.String classEntryString)
Entries in a zip file are directory entries using slashes to separate them.
|
static java.util.Set<java.lang.String> |
buildClassSet(javax.persistence.spi.PersistenceUnitInfo persistenceUnitInfo,
java.lang.ClassLoader loader)
Build a set that contains all the class names at a URL
|
static java.util.Collection<java.lang.Class> |
buildEntityList(MetadataProcessor processor,
java.lang.ClassLoader loader)
Create a list of the entities that will be deployed.
|
static java.util.Set<Archive> |
findPersistenceArchives()
Search the classpath for persistence archives.
|
static java.util.Set<Archive> |
findPersistenceArchives(java.lang.ClassLoader loader)
Search the classpath for persistence archives.
|
static java.util.Set<java.lang.String> |
getClassNamesFromURL(java.net.URL url) |
static java.util.Set<java.lang.String> |
getEntityClassNamesFromURL(java.net.URL url,
java.lang.ClassLoader loader) |
static java.util.List<SEPersistenceUnitInfo> |
getPersistenceUnits(Archive archive,
java.lang.ClassLoader loader)
Get a list of persitence units from the file or directory at the given url
PersistenceUnits are built based on the presence of persistence.xml in a META-INF directory
at the base of the URL
|
static boolean |
isEntity(java.lang.Class candidateClass)
Return whether a given class is annotated with @Entity.
|
static boolean |
isEntity(java.lang.String className,
java.lang.ClassLoader loader,
boolean throwExceptionIfNotFound)
Return whether the class with the given name is annotated with @Entity.
|
static void |
processORMetadata(MetadataProcessor processor,
java.lang.ClassLoader privateClassLoader,
AbstractSession session,
boolean throwExceptionOnFail)
Process the Object/relational metadata from XML and annotations
|
static java.util.List<SEPersistenceUnitInfo> |
processPersistenceArchive(Archive archive,
java.lang.ClassLoader loader)
Go through the jar file for this PeristeneUnitProcessor and process any XML provided in it
|
public static java.util.List<SEPersistenceUnitInfo> getPersistenceUnits(Archive archive, java.lang.ClassLoader loader)
archive
- The url of a jar file or directory to checkpublic static java.util.List<SEPersistenceUnitInfo> processPersistenceArchive(Archive archive, java.lang.ClassLoader loader)
public static java.lang.String buildClassNameFromEntryString(java.lang.String classEntryString)
classEntryString
- public static java.util.Set<java.lang.String> buildClassSet(javax.persistence.spi.PersistenceUnitInfo persistenceUnitInfo, java.lang.ClassLoader loader)
public static java.util.Set<Archive> findPersistenceArchives()
public static java.util.Set<Archive> findPersistenceArchives(java.lang.ClassLoader loader)
Archive
representing the root of those files.loader
- the class loader to get the class path frompublic static java.util.Set<java.lang.String> getClassNamesFromURL(java.net.URL url)
public static java.util.Set<java.lang.String> getEntityClassNamesFromURL(java.net.URL url, java.lang.ClassLoader loader)
public static boolean isEntity(java.lang.String className, java.lang.ClassLoader loader, boolean throwExceptionIfNotFound)
className
- public static boolean isEntity(java.lang.Class candidateClass)
candidateClass
- public static void processORMetadata(MetadataProcessor processor, java.lang.ClassLoader privateClassLoader, AbstractSession session, boolean throwExceptionOnFail)
processor
- privateClassLoader
- session
- throwExceptionOnFail
- public static java.util.Collection<java.lang.Class> buildEntityList(MetadataProcessor processor, java.lang.ClassLoader loader)
loader
-