public class PersistenceUnitProcessor
extends java.lang.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 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.util.Map properties)
Build a set that contains all the class names at a URL.
|
static java.util.Collection<MetadataClass> |
buildEntityList(MetadataProcessor processor,
java.lang.ClassLoader loader)
Create a list of the entities that will be deployed.
|
static java.lang.String |
buildPersistenceUnitName(java.net.URL url,
java.lang.String puName)
Build the unique persistence name by concatenating the decoded URL with the persistence unit name.
|
static java.net.URL |
computePURootURL(java.net.URL pxmlURL,
java.lang.String descriptorLocation)
Determine the URL path to the persistence unit
|
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<Archive> |
findPersistenceArchives(java.lang.ClassLoader loader,
java.lang.String descriptorPath)
Return a list of Archives representing the root of the persistence descriptor.
|
static java.util.Set<Archive> |
findPersistenceArchives(java.lang.ClassLoader loader,
java.lang.String descriptorPath,
java.util.List<java.net.URL> jarFileUrls)
Return a list of Archives representing the root of the persistence descriptor.
|
static ArchiveFactory |
getArchiveFactory(java.lang.ClassLoader loader) |
static java.util.Set<java.lang.String> |
getClassNamesFromURL(java.net.URL url,
java.lang.ClassLoader loader,
java.util.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 java.util.List<SEPersistenceUnitInfo> |
getPersistenceUnits(Archive archive,
java.lang.ClassLoader loader)
Get a list of persistence units from the file or directory at the given
url.
|
static java.util.Set<SEPersistenceUnitInfo> |
getPersistenceUnits(java.lang.ClassLoader loader,
java.util.Map m,
java.util.List<java.net.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 java.lang.Class |
loadClass(java.lang.String className,
java.lang.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 java.util.List<SEPersistenceUnitInfo> |
processPersistenceArchive(Archive archive,
java.lang.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 java.lang.String buildClassNameFromEntryString(java.lang.String classEntryString)
public static java.util.Set<java.lang.String> buildClassSet(javax.persistence.spi.PersistenceUnitInfo persistenceUnitInfo, java.util.Map properties)
public static java.util.Collection<MetadataClass> buildEntityList(MetadataProcessor processor, java.lang.ClassLoader loader)
public static java.net.URL computePURootURL(java.net.URL pxmlURL, java.lang.String descriptorLocation) throws java.io.IOException, java.net.URISyntaxException
pxmlURL
- - Encoded URL containing the pujava.io.IOException
java.net.URISyntaxException
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. It is the caller's responsibility
to close all the archives.loader
- the class loader to get the class path frompublic static java.util.Set<Archive> findPersistenceArchives(java.lang.ClassLoader loader, java.lang.String descriptorPath)
loader
- the class loader to get the class path frompublic static java.util.Set<Archive> findPersistenceArchives(java.lang.ClassLoader loader, java.lang.String descriptorPath, java.util.List<java.net.URL> jarFileUrls)
loader
- the class loader to get the class path frompublic static java.util.Set<SEPersistenceUnitInfo> getPersistenceUnits(java.lang.ClassLoader loader, java.util.Map m, java.util.List<java.net.URL> jarFileUrls)
public static ArchiveFactory getArchiveFactory(java.lang.ClassLoader loader)
public static java.util.Set<java.lang.String> getClassNamesFromURL(java.net.URL url, java.lang.ClassLoader loader, java.util.Map properties)
public static MetadataAnnotation getConverterAnnotation(MetadataClass candidateClass)
public static MetadataAnnotation getEmbeddableAnnotation(MetadataClass candidateClass)
public static MetadataAnnotation getEntityAnnotation(MetadataClass candidateClass)
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 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 java.lang.Class loadClass(java.lang.String className, java.lang.ClassLoader loader, boolean throwExceptionIfNotFound, MetadataProject project)
public static void processORMetadata(MetadataProcessor processor, boolean throwExceptionOnFail, PersistenceUnitProcessor.Mode mode)
public static java.util.List<SEPersistenceUnitInfo> processPersistenceArchive(Archive archive, java.lang.ClassLoader loader)
public static void setArchiveFactory(ArchiveFactory factory)
public static java.lang.String buildPersistenceUnitName(java.net.URL url, java.lang.String puName)
URL
- puName
- EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference