Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.metadata.xml

public Class XMLEntityMappingsReader

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .InputStreamReader, .Reader, .UnsupportedEncodingException, java.net.URL, java.util.Map, .Properties, javax.xml.parsers.SAXParser, .SAXParserFactory, javax.xml.transform.stream.StreamSource, javax.xml.validation.Schema, .SchemaFactory, org.eclipse.persistence.config.PersistenceUnitProperties, org.eclipse.persistence.exceptions.EclipseLinkException, .ValidationException, org.eclipse.persistence.internal.helper.XMLHelper, org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider, org.eclipse.persistence.oxm.XMLConstants, .XMLContext, .XMLUnmarshaller, org.xml.sax.ErrorHandler, .InputSource, .SAXException, .SAXParseException, .XMLReader

ORM.xml reader.
Author
Guy Pelletier
Since
EclipseLink 1.0

Field Summary

Modifier and TypeField and Description
private static XMLContext
private static Schema
private static XMLContext
private static Schema
private static XMLContext
private static Schema
private static XMLContext
private static Schema
private static XMLContext
private static Schema
private static XMLContext
private static Schema
private static XMLContext
private static Schema
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
clear()

Free the project and schema objects to avoid holding onto the memory.

private static Object[]
determineXMLContextAndSchema(String file, Reader input, boolean validateSchema)

Check the orm.xml to determine which project and schema to use.

public static XMLContext

Returns:

the Eclipselink orm project.
getEclipseLinkOrmProject
()

public static Schema

Returns:

the Eclipselink orm schema.
getEclipseLinkOrmSchema
()

private static InputStreamReader
getInputStreamReader(URL url)

Gets a reader from given URL.

public static XMLContext

Returns:

the JPA 1.0 orm project.
getOrm1_0Project
()

public static Schema

Returns:

the JPA 1.0 orm schema.
getOrm1_0Schema
()

public static XMLContext

Returns:

the JPA 2.0 orm project.
getOrm2_0Project
()

public static Schema

Returns:

the JPA 2.0 orm schema.
getOrm2_0Schema
()

public static XMLContext

Returns:

the JPA 2.1 orm project.
getOrm2_1Project
()

public static Schema

Returns:

the JPA 2.1 orm schema.
getOrm2_1Schema
()

public static XMLContext

Returns:

the JPA 2.2 orm project.
getOrm2_2Project
()

public static Schema

Returns:

the JPA 2.2 orm schema.
getOrm2_2Schema
()

public static XMLContext

Returns:

the JPA 3.0 orm project.
getOrm3_0Project
()

public static Schema

Returns:

the JPA 3.0 orm schema.
getOrm3_0Schema
()

public static XMLContext

Returns:

the JPA 3.1 orm project.
getOrm3_1Project
()

public static Schema

Returns:

the JPA 3.1 orm schema.
getOrm3_1Schema
()

private static boolean
isORMSchemaValidationPerformed(Map<K, V>
- PersistenceUnitInfo properties on the project
properties
)

INTERNAL: Return whether the schema validation flag in the Persistence Unit eclipselink.orm.validate.schema is set to true or false.

protected static Schema
loadLocalSchema(String schemaName)

Load the XML schema from the jar resource.

public static XMLEntityMappings
read(String sourceName, Reader reader, ClassLoader classLoader, Map<K, V> properties)

INTERNAL:

protected static XMLEntityMappings
read(String mappingFile, Reader reader1, Reader reader2, ClassLoader classLoader, Map<K, V> properties)

INTERNAL:

public static XMLEntityMappings
read(URL url, ClassLoader classLoader, Properties
- PersistenceUnitInfo properties on the project
properties
)

INTERNAL:

private static void
useLocalSchemaForUnmarshaller(XMLUnmarshaller unmarshaller, Schema schema)

This method allows you to set an XML schema on a given unmarshaller.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_eclipseLinkOrmProjectback to summary
private static XMLContext m_eclipseLinkOrmProject
m_eclipseLinkOrmSchemaback to summary
private static Schema m_eclipseLinkOrmSchema
m_orm1_0Projectback to summary
private static XMLContext m_orm1_0Project
m_orm1_0Schemaback to summary
private static Schema m_orm1_0Schema
m_orm2_0Projectback to summary
private static XMLContext m_orm2_0Project
m_orm2_0Schemaback to summary
private static Schema m_orm2_0Schema
m_orm2_1Projectback to summary
private static XMLContext m_orm2_1Project
m_orm2_1Schemaback to summary
private static Schema m_orm2_1Schema
m_orm2_2Projectback to summary
private static XMLContext m_orm2_2Project
m_orm2_2Schemaback to summary
private static Schema m_orm2_2Schema
m_orm3_0Projectback to summary
private static XMLContext m_orm3_0Project
m_orm3_0Schemaback to summary
private static Schema m_orm3_0Schema
m_orm3_1Projectback to summary
private static XMLContext m_orm3_1Project
m_orm3_1Schemaback to summary
private static Schema m_orm3_1Schema
ORM_1_0_NAMESPACEback to summary
public static final String ORM_1_0_NAMESPACE
ORM_1_0_XSDback to summary
public static final String ORM_1_0_XSD
ORM_2_0_NAMESPACEback to summary
public static final String ORM_2_0_NAMESPACE
ORM_2_0_XSDback to summary
public static final String ORM_2_0_XSD
ORM_2_1_NAMESPACEback to summary
public static final String ORM_2_1_NAMESPACE
ORM_2_1_XSDback to summary
public static final String ORM_2_1_XSD
ORM_2_2_NAMESPACEback to summary
public static final String ORM_2_2_NAMESPACE
ORM_2_2_XSDback to summary
public static final String ORM_2_2_XSD
ORM_3_0_NAMESPACEback to summary
public static final String ORM_3_0_NAMESPACE
ORM_3_0_XSDback to summary
public static final String ORM_3_0_XSD
ORM_3_1_NAMESPACEback to summary
public static final String ORM_3_1_NAMESPACE
ORM_3_1_XSDback to summary
public static final String ORM_3_1_XSD

Constructor Detail

XMLEntityMappingsReaderback to summary
private XMLEntityMappingsReader()

Method Detail

clearback to summary
public static void clear()

Free the project and schema objects to avoid holding onto the memory. This can be done post-deployment to conserve memory.

determineXMLContextAndSchemaback to summary
private static Object[] determineXMLContextAndSchema(String file, Reader input, boolean validateSchema) throws Exception

Check the orm.xml to determine which project and schema to use. EclipseLink ORM is used if input Reader is null

getEclipseLinkOrmProjectback to summary
public static XMLContext getEclipseLinkOrmProject()
Returns:XMLContext

the Eclipselink orm project.

getEclipseLinkOrmSchemaback to summary
public static Schema getEclipseLinkOrmSchema() throws IOException, SAXException
Returns:Schema

the Eclipselink orm schema.

getInputStreamReaderback to summary
private static InputStreamReader getInputStreamReader(URL url) throws IOException

Gets a reader from given URL.

getOrm1_0Projectback to summary
public static XMLContext getOrm1_0Project()
Returns:XMLContext

the JPA 1.0 orm project.

getOrm1_0Schemaback to summary
public static Schema getOrm1_0Schema() throws IOException, SAXException
Returns:Schema

the JPA 1.0 orm schema.

getOrm2_0Projectback to summary
public static XMLContext getOrm2_0Project()
Returns:XMLContext

the JPA 2.0 orm project.

getOrm2_0Schemaback to summary
public static Schema getOrm2_0Schema() throws IOException, SAXException
Returns:Schema

the JPA 2.0 orm schema.

getOrm2_1Projectback to summary
public static XMLContext getOrm2_1Project()
Returns:XMLContext

the JPA 2.1 orm project.

getOrm2_1Schemaback to summary
public static Schema getOrm2_1Schema() throws IOException, SAXException
Returns:Schema

the JPA 2.1 orm schema.

getOrm2_2Projectback to summary
public static XMLContext getOrm2_2Project()
Returns:XMLContext

the JPA 2.2 orm project.

getOrm2_2Schemaback to summary
public static Schema getOrm2_2Schema() throws IOException, SAXException
Returns:Schema

the JPA 2.2 orm schema.

getOrm3_0Projectback to summary
public static XMLContext getOrm3_0Project()
Returns:XMLContext

the JPA 3.0 orm project.

getOrm3_0Schemaback to summary
public static Schema getOrm3_0Schema() throws IOException, SAXException
Returns:Schema

the JPA 3.0 orm schema.

getOrm3_1Projectback to summary
public static XMLContext getOrm3_1Project()
Returns:XMLContext

the JPA 3.1 orm project.

getOrm3_1Schemaback to summary
public static Schema getOrm3_1Schema() throws IOException, SAXException
Returns:Schema

the JPA 3.1 orm schema.

isORMSchemaValidationPerformedback to summary
private static boolean isORMSchemaValidationPerformed(Map<K, V> properties)

INTERNAL: Return whether the schema validation flag in the Persistence Unit eclipselink.orm.validate.schema is set to true or false.
The default value is false.

Parameters
properties:Map<K, V>

- PersistenceUnitInfo properties on the project

loadLocalSchemaback to summary
protected static Schema loadLocalSchema(String schemaName) throws IOException, SAXException

Load the XML schema from the jar resource.

readback to summary
public static XMLEntityMappings read(String sourceName, Reader reader, ClassLoader classLoader, Map<K, V> properties)

INTERNAL:

readback to summary
protected static XMLEntityMappings read(String mappingFile, Reader reader1, Reader reader2, ClassLoader classLoader, Map<K, V> properties)

INTERNAL:

readback to summary
public static XMLEntityMappings read(URL url, ClassLoader classLoader, Properties properties) throws IOException

INTERNAL:

Parameters
properties:Properties

- PersistenceUnitInfo properties on the project

useLocalSchemaForUnmarshallerback to summary
private static void useLocalSchemaForUnmarshaller(XMLUnmarshaller unmarshaller, Schema schema)

This method allows you to set an XML schema on a given unmarshaller. It will get the schema from the same classloader that loaded this class and hence works for the case where the schema is shipped as part of EclipseLink