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