public class PersistenceUnitProcessor extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PersistenceUnitProcessor.Mode
Passed to processORMetadata method to indicate processing mode.
|
Modifier and Type | Field and Description |
---|---|
static ArchiveFactory |
ARCHIVE_FACTORY
Cache the ArchiveFactory used to derive Archives.
|
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(javax.persistence.spi.PersistenceUnitInfo persistenceUnitInfo,
Map properties)
Build a set that contains all the class names at a URL.
|
static Collection<MetadataClass> |
buildEntityList(MetadataProcessor processor,
ClassLoader loader)
Create a list of the entities that will be deployed.
|
static String |
buildPersistenceUnitName(URL url,
String puName)
Build the unique persistence name by concatenating the decoded URL with the persistence unit name.
|
static URL |
computePURootURL(URL pxmlURL,
String descriptorLocation)
Determine the URL path to the persistence unit
|
static Set<Archive> |
findPersistenceArchives()
Search the classpath for persistence archives.
|
static Set<Archive> |
findPersistenceArchives(ClassLoader loader)
Search the classpath for persistence archives.
|
static Set<Archive> |
findPersistenceArchives(ClassLoader loader,
String descriptorPath)
Return a list of Archives representing the root of the persistence descriptor.
|
static Set<Archive> |
findPersistenceArchives(ClassLoader loader,
String descriptorPath,
List<URL> jarFileUrls)
Return a list of Archives representing the root of the persistence descriptor.
|
static ArchiveFactory |
getArchiveFactory(ClassLoader loader) |
static Set<String> |
getClassNamesFromURL(URL url,
ClassLoader loader,
Map properties) |
static MetadataAnnotation |
getConverterAnnotation(MetadataClass candidateClass)
Return if a given class is annotated with @Embeddable.
|
static MetadataAnnotation |
getEmbeddableAnnotation(MetadataClass candidateClass)
Return if a given class is annotated with @Embeddable.
|
static MetadataAnnotation |
getEntityAnnotation(MetadataClass candidateClass)
Return if a given class is annotated with @Entity.
|
static MetadataAnnotation |
getMappedSuperclassAnnotation(MetadataClass candidateClass)
Return if a given class is annotated with @Entity.
|
static List<SEPersistenceUnitInfo> |
getPersistenceUnits(Archive archive,
ClassLoader loader)
Get a list of persistence units from the file or directory at the given
url.
|
static Set<SEPersistenceUnitInfo> |
getPersistenceUnits(ClassLoader loader,
Map m,
List<URL> jarFileUrls) |
static MetadataAnnotation |
getStaticMetamodelAnnotation(MetadataClass candidateClass)
Return the @StaticMetamodel annotation on the given class.
|
static boolean |
isConverter(MetadataClass candidateClass)
Return if a given class is annotated with @Converter.
|
static boolean |
isEmbeddable(MetadataClass candidateClass)
Return if a given class is annotated with @Embeddable.
|
static boolean |
isEntity(MetadataClass candidateClass)
Return if a given class is annotated with @Entity.
|
static boolean |
isMappedSuperclass(MetadataClass candidateClass)
Return if a given class is annotated with @MappedSuperclass.
|
static boolean |
isStaticMetamodelClass(MetadataClass candidateClass)
Return if a given class is annotated with @StaticMetamodel.
|
static Class |
loadClass(String className,
ClassLoader loader,
boolean throwExceptionIfNotFound,
MetadataProject project)
Load the given class name with the given class loader.
|
static void |
processORMetadata(MetadataProcessor processor,
boolean throwExceptionOnFail,
PersistenceUnitProcessor.Mode mode)
Process the Object/relational metadata from XML and annotations
|
static List<SEPersistenceUnitInfo> |
processPersistenceArchive(Archive archive,
ClassLoader loader)
Go through the jar file for this PersistenceUnitProcessor and process any
XML provided in it.
|
static void |
setArchiveFactory(ArchiveFactory factory) |
public static ArchiveFactory ARCHIVE_FACTORY
public static String buildClassNameFromEntryString(String classEntryString)
public static Set<String> buildClassSet(javax.persistence.spi.PersistenceUnitInfo persistenceUnitInfo, Map properties)
public static Collection<MetadataClass> buildEntityList(MetadataProcessor processor, ClassLoader loader)
public static URL computePURootURL(URL pxmlURL, String descriptorLocation) throws IOException, URISyntaxException
pxmlURL
- - Encoded URL containing the puIOException
URISyntaxException
public static Set<Archive> findPersistenceArchives()
public static Set<Archive> findPersistenceArchives(ClassLoader loader)
Archive
representing the root of those files. It is the caller's responsibility
to close all the archives.loader
- the class loader to get the class path frompublic static Set<Archive> findPersistenceArchives(ClassLoader loader, String descriptorPath)
loader
- the class loader to get the class path frompublic static Set<Archive> findPersistenceArchives(ClassLoader loader, String descriptorPath, List<URL> jarFileUrls)
loader
- the class loader to get the class path frompublic static Set<SEPersistenceUnitInfo> getPersistenceUnits(ClassLoader loader, Map m, List<URL> jarFileUrls)
public static ArchiveFactory getArchiveFactory(ClassLoader loader)
public static Set<String> getClassNamesFromURL(URL url, ClassLoader loader, Map properties)
public static MetadataAnnotation getConverterAnnotation(MetadataClass candidateClass)
public static MetadataAnnotation getEmbeddableAnnotation(MetadataClass candidateClass)
public static MetadataAnnotation getEntityAnnotation(MetadataClass candidateClass)
public static List<SEPersistenceUnitInfo> getPersistenceUnits(Archive archive, ClassLoader loader)
archive
- The url of a jar file or directory to checkpublic static MetadataAnnotation getMappedSuperclassAnnotation(MetadataClass candidateClass)
public static MetadataAnnotation getStaticMetamodelAnnotation(MetadataClass candidateClass)
public static boolean isConverter(MetadataClass candidateClass)
public static boolean isEmbeddable(MetadataClass candidateClass)
public static boolean isEntity(MetadataClass candidateClass)
public static boolean isStaticMetamodelClass(MetadataClass candidateClass)
public static boolean isMappedSuperclass(MetadataClass candidateClass)
public static Class loadClass(String className, ClassLoader loader, boolean throwExceptionIfNotFound, MetadataProject project)
public static void processORMetadata(MetadataProcessor processor, boolean throwExceptionOnFail, PersistenceUnitProcessor.Mode mode)
public static List<SEPersistenceUnitInfo> processPersistenceArchive(Archive archive, ClassLoader loader)
public static void setArchiveFactory(ArchiveFactory factory)
public static String buildPersistenceUnitName(URL url, String puName)
URL
- puName
- EclipseLink 2.5.2, "build v20140319-9ad6abd" API Reference