public class XMLMetadataSource extends MetadataSourceAdapter
Purpose: Support reading metadata for a persistence unit in an XML format from a URL and if the property is undefined, it will look for a file.
Constructor and Description |
---|
XMLMetadataSource() |
Modifier and Type | Method and Description |
---|---|
Object |
getConfigPropertyLogDebug(String propertyName,
Map properties,
SessionLog log)
Check the provided map for an object with the given name.
|
org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappings |
getEntityMappings(Map<String,Object> properties,
ClassLoader classLoader,
SessionLog log)
This method is responsible for returning the object representation of the MetadataSource.
|
Reader |
getEntityMappingsReader(Map<String,Object> properties,
ClassLoader classLoader,
SessionLog log)
This method returns a Reader for an EclipseLink-ORM.xml.
|
protected static URL |
getFileURL(String fileName,
ClassLoader classLoader,
SessionLog log) |
Map<String,Object> |
getPropertyOverrides(Map<String,Object> properties,
ClassLoader classLoader,
SessionLog log)
PUBLIC: This method is responsible for returning additional persistence
unit property overrides.
|
String |
getRepositoryName()
Used by getEntityMappings when creating the XMLEntityMappings as a way of describing where it was read from.
|
public Reader getEntityMappingsReader(Map<String,Object> properties, ClassLoader classLoader, SessionLog log)
properties
- classLoader
- log
- - SessionLog used for status messages.getEntityMappings(java.util.Map<java.lang.String, java.lang.Object>, java.lang.ClassLoader, org.eclipse.persistence.logging.SessionLog)
public org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappings getEntityMappings(Map<String,Object> properties, ClassLoader classLoader, SessionLog log)
getEntityMappings
in interface MetadataSource
getEntityMappings
in class MetadataSourceAdapter
public String getRepositoryName()
public Map<String,Object> getPropertyOverrides(Map<String,Object> properties, ClassLoader classLoader, SessionLog log)
IMPORTANT: Although any property can be changed using this approach it is important that users of this feature ensure compatible configurations are supplied. As an example; overriding an application to use RESOURCE_LOCAL when it was coded to use JTA would result in changes not be written to the database. PersistenceUnitProperties.METADATA_SOURCE_PROPERTIES_FILE property will be used to get a file resource from the classloader. Properties are read from the file. If the property either not specified or contains an empty string then returns null.
protected static URL getFileURL(String fileName, ClassLoader classLoader, SessionLog log) throws IOException
IOException
public Object getConfigPropertyLogDebug(String propertyName, Map properties, SessionLog log)
propertyName
- properties
- log
- Copyright © 2007–2020 Eclipse.org - EclipseLink Project. All rights reserved.