Class XmlEntityMappingsGenerator
java.lang.Object
org.eclipse.persistence.tools.dbws.XmlEntityMappingsGenerator
This class is responsible for generating an XMLEntityMappings instance based
on a given OR Project's Queries and Descriptors.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
addQueryHint
(NamedNativeQueryMetadata metadata) Adds a ReturnNameValuePairsHint to the given query metadata instance.protected static MappingAccessor
generateMappingAccessor
(DatabaseMapping mapping, List<String> embeddables) Process a given DatabaseMapping and return a MappingAccessor.static XMLEntityMappings
generateXmlEntityMappings
(Project orProject, List<CompositeDatabaseType> complexTypes, Map<String, Map<String, String>> crudOperations) Generate an XMLEntityMappings instance based on a given OR Project's Queries and Descriptors.static String
getDirectionAsString
(DatasourceCall.ParameterType direction) Return a parameter direction as a String based on a given in value.static String
Return a parameter mode as a String based on a given in value.protected static ArrayAccessor
processArrayMapping
(ArrayMapping mapping) Generate a MappingAccessor for a given ArrayMapping.protected static List
<ComplexTypeMetadata> processCompositeTypes
(List<CompositeDatabaseType> complexTypes, Project orProject) Returns a list of ComplexTypeMetadata instances generated based on a list of CompositeDatabaseTypes.protected static ComplexTypeMetadata
processDatabaseType
(CompositeDatabaseType cdbType, Project orProject) Process the given CompositeDatabaseType and return a ComplexTypeMetadata instance.protected static ComplexTypeMetadata
processDatabaseType
(CompositeDatabaseType cdbType, Project orProject, List<String> processedTypeNames) Process the given CompositeDatabaseType and return a ComplexTypeMetadata instance.protected static BasicAccessor
processDirectMapping
(DirectToFieldMapping mapping) Generate a MappingAccessor for a given DirectToFieldMapping.protected static EmbeddedAccessor
processEmbeddedMapping
(AggregateMapping mapping) Generate an EmbeddedAccessor for a given AggregateMapping.protected static ArrayAccessor
Generate a MappingAccessor for a given ObjectArrayMapping.protected static ComplexTypeMetadata
processObjectTableType
(ObjectTableType oTableType, Project orProject) Process the given ObjectTableType and return an OracleArrayTypeMetadata instance.protected static ComplexTypeMetadata
processObjectType
(ObjectType oType, Project orProject) Process the given ObjectType and return an OracleObjectTypeMetadata instance.protected static ComplexTypeMetadata
processPLSQLCollectionType
(PLSQLCollectionType plsqlCollectionType) Process the given PLSQLCollectionType and return a PLSQLTableMetadata instance.protected static ComplexTypeMetadata
processPLSQLRecordType
(PLSQLRecordType plsqlRecordType) Process the given PLSQLRecordType and return a PLSQLRecordMetadata instance.protected static StructureAccessor
processStructureMapping
(StructureMapping mapping) Generate a MappingAccessor for a given StructureMapping.protected static String
processTypeName
(String typeName) Alter the given type name if required.protected static ComplexTypeMetadata
processVArrayType
(VArrayType vType, Project orProject) Process the given VArrayType and return an OracleArrayTypeMetadata instance.
-
Constructor Details
-
XmlEntityMappingsGenerator
public XmlEntityMappingsGenerator()
-
-
Method Details
-
generateXmlEntityMappings
public static XMLEntityMappings generateXmlEntityMappings(Project orProject, List<CompositeDatabaseType> complexTypes, Map<String, Map<String, String>> crudOperations) Generate an XMLEntityMappings instance based on a given OR Project's Queries and Descriptors.- Parameters:
orProject
- the ORM Project instance containing Queries and Descriptors to be used to generate an XMLEntityMappingscomplexTypes
- list of composite database types used to generate metadata for advanced Oracle and PL/SQL typescrudOperations
- map of maps keyed on table name - the second map are operation name to SQL string entries
-
generateMappingAccessor
protected static MappingAccessor generateMappingAccessor(DatabaseMapping mapping, List<String> embeddables) Process a given DatabaseMapping and return a MappingAccessor. Expected mappings are:- org.eclipse.persistence.mappings.DirectToFieldMapping
- org.eclipse.persistence.mappings.structures.ArrayMapping
- org.eclipse.persistence.mappings.structures.ObjectArrayMapping
- org.eclipse.persistence.mappings.structures.StructureMapping
-
processDirectMapping
Generate a MappingAccessor for a given DirectToFieldMapping. -
processArrayMapping
Generate a MappingAccessor for a given ArrayMapping. -
processObjectArrayMapping
Generate a MappingAccessor for a given ObjectArrayMapping. -
processStructureMapping
Generate a MappingAccessor for a given StructureMapping. -
processEmbeddedMapping
Generate an EmbeddedAccessor for a given AggregateMapping. -
getDirectionAsString
Return a parameter direction as a String based on a given in value. Expected 'direction' value is one of:- org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType.IN
- org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType.INOUT
- org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType.OUT
- org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType.OUT_CURSOR
-
getParameterModeAsString
Return a parameter mode as a String based on a given in value. Expected 'direction' value is one of:- org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType.IN
- org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType.INOUT
- org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType.OUT
- org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType.OUT_CURSOR
- org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.JPA_PARAMETER_IN
- org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.JPA_PARAMETER_INOUT
- org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.JPA_PARAMETER_OUT
- org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.JPA_PARAMETER_REF_CURSOR
-
processTypeName
Alter the given type name if required. -
processCompositeTypes
protected static List<ComplexTypeMetadata> processCompositeTypes(List<CompositeDatabaseType> complexTypes, Project orProject) Returns a list of ComplexTypeMetadata instances generated based on a list of CompositeDatabaseTypes. The given non-empty list should contain one or more of the following types:- PLSQLCollectionType
- PLSQLRecordType
- ObjectTableType
- ObjectType
- VArrayType
-
processDatabaseType
protected static ComplexTypeMetadata processDatabaseType(CompositeDatabaseType cdbType, Project orProject) Process the given CompositeDatabaseType and return a ComplexTypeMetadata instance. The given type is expected to be one of:- PLSQLCollectionType
- PLSQLRecordType
- ObjectTableType
- ObjectType
- VArrayType
-
processDatabaseType
protected static ComplexTypeMetadata processDatabaseType(CompositeDatabaseType cdbType, Project orProject, List<String> processedTypeNames) Process the given CompositeDatabaseType and return a ComplexTypeMetadata instance. The given type is expected to be one of:- PLSQLCollectionType
- PLSQLRecordType
- ObjectTableType
- ObjectType
- VArrayType
-
processPLSQLCollectionType
protected static ComplexTypeMetadata processPLSQLCollectionType(PLSQLCollectionType plsqlCollectionType) Process the given PLSQLCollectionType and return a PLSQLTableMetadata instance. -
processPLSQLRecordType
Process the given PLSQLRecordType and return a PLSQLRecordMetadata instance. -
processObjectTableType
protected static ComplexTypeMetadata processObjectTableType(ObjectTableType oTableType, Project orProject) Process the given ObjectTableType and return an OracleArrayTypeMetadata instance. -
processObjectType
Process the given ObjectType and return an OracleObjectTypeMetadata instance. -
processVArrayType
Process the given VArrayType and return an OracleArrayTypeMetadata instance. -
addQueryHint
Adds a ReturnNameValuePairsHint to the given query metadata instance.
-