Module org.datanucleus.store.rdbms
Interface MappingManager
-
- All Known Implementing Classes:
MappingManagerImpl
,OracleMappingManagerImpl
public interface MappingManager
Representation of a MappingManager, mapping a java mapping type to a column mapping type. Allows a java mapping type to map to multiple column mapping types. Allows a default column mapping type be assigned to each java mapping type.
-
-
Field Summary
Fields Modifier and Type Field Description static String
METADATA_EXTENSION_INSERT_FUNCTION
static String
METADATA_EXTENSION_SELECT_FUNCTION
static String
METADATA_EXTENSION_UPDATE_FUNCTION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Column
createColumn(org.datanucleus.metadata.AbstractMemberMetaData fmd, Table table, JavaTypeMapping mapping, org.datanucleus.metadata.ColumnMetaData colmd, Column referenceCol, org.datanucleus.ClassLoaderResolver clr)
Method to create a column for a persistable mapping.Column
createColumn(JavaTypeMapping mapping, String javaType, int datastoreFieldIndex)
Method to create a column in a container (table).Column
createColumn(JavaTypeMapping mapping, String javaType, org.datanucleus.metadata.ColumnMetaData colmd)
Method to create a column in a container (table).ColumnMapping
createColumnMapping(JavaTypeMapping mapping, org.datanucleus.metadata.AbstractMemberMetaData fmd, int index, Column column)
Method to create the column mapping for a java type mapping at a particular index.ColumnMapping
createColumnMapping(JavaTypeMapping mapping, Column column, String javaType)
Method to create the column mapping for a particular column and java type.JavaTypeMapping
getMapping(Class javaType)
Accessor for a mapping, for a java type.JavaTypeMapping
getMapping(Class javaType, boolean serialised, boolean embedded, String fieldName)
Accessor for a mapping, for a java type.JavaTypeMapping
getMapping(Table table, org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.FieldRole fieldRole)
Accessor for the mapping for the field of the specified table.Class<? extends JavaTypeMapping>
getMappingType(String javaTypeName)
Accessor for the JavaTypeMapping class for the supplied java type.JavaTypeMapping
getMappingWithColumnMapping(Class javaType, boolean serialised, boolean embedded, org.datanucleus.ClassLoaderResolver clr)
Accessor for a mapping, for a java type complete with the column mapping.boolean
isSupportedMappedType(String javaTypeName)
Accessor for whether a java type is supported as being mappable.
-
-
-
Field Detail
-
METADATA_EXTENSION_INSERT_FUNCTION
static final String METADATA_EXTENSION_INSERT_FUNCTION
- See Also:
- Constant Field Values
-
METADATA_EXTENSION_UPDATE_FUNCTION
static final String METADATA_EXTENSION_UPDATE_FUNCTION
- See Also:
- Constant Field Values
-
METADATA_EXTENSION_SELECT_FUNCTION
static final String METADATA_EXTENSION_SELECT_FUNCTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
isSupportedMappedType
boolean isSupportedMappedType(String javaTypeName)
Accessor for whether a java type is supported as being mappable.- Parameters:
javaTypeName
- The java type name- Returns:
- Whether the class is supported (to some degree)
-
getMappingType
Class<? extends JavaTypeMapping> getMappingType(String javaTypeName)
Accessor for the JavaTypeMapping class for the supplied java type.- Parameters:
javaTypeName
- The java type name- Returns:
- The JavaTypeMapping class to use
-
createColumnMapping
ColumnMapping createColumnMapping(JavaTypeMapping mapping, org.datanucleus.metadata.AbstractMemberMetaData fmd, int index, Column column)
Method to create the column mapping for a java type mapping at a particular index.- Parameters:
mapping
- The java mappingfmd
- MetaData for the fieldindex
- Index of the columncolumn
- The column- Returns:
- The column mapping
-
createColumnMapping
ColumnMapping createColumnMapping(JavaTypeMapping mapping, Column column, String javaType)
Method to create the column mapping for a particular column and java type.- Parameters:
mapping
- The java mappingcolumn
- The columnjavaType
- The java type (isn't this stored in the java mapping ?)- Returns:
- The column mapping
-
getMapping
JavaTypeMapping getMapping(Class javaType)
Accessor for a mapping, for a java type. Same as calling "getMapping(c, false, false, (String)null);"- Parameters:
javaType
- The java type- Returns:
- The mapping
-
getMapping
JavaTypeMapping getMapping(Class javaType, boolean serialised, boolean embedded, String fieldName)
Accessor for a mapping, for a java type.- Parameters:
javaType
- The java typeserialised
- Whether the type is serialisedembedded
- Whether the type is embeddedfieldName
- Name of the field (for logging only)- Returns:
- The mapping
-
getMappingWithColumnMapping
JavaTypeMapping getMappingWithColumnMapping(Class javaType, boolean serialised, boolean embedded, org.datanucleus.ClassLoaderResolver clr)
Accessor for a mapping, for a java type complete with the column mapping.- Parameters:
javaType
- The java typeserialised
- Whether the type is serialisedembedded
- Whether the type is embeddedclr
- ClassLoader resolver- Returns:
- The mapping
-
getMapping
JavaTypeMapping getMapping(Table table, org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.FieldRole fieldRole)
Accessor for the mapping for the field of the specified table. Can be used for fields of a class, elements of a collection of a class, elements of an array of a class, keys of a map of a class, values of a map of a class. This is controlled by the final argument "roleForMember".- Parameters:
table
- Table to add the mapping tommd
- MetaData for the field/property to mapclr
- The ClassLoaderResolverfieldRole
- Role that this mapping plays for the field/property- Returns:
- The mapping for the field.
-
createColumn
Column createColumn(JavaTypeMapping mapping, String javaType, int datastoreFieldIndex)
Method to create a column in a container (table).- Parameters:
mapping
- The java mappingjavaType
- The java typedatastoreFieldIndex
- The index of the column to create- Returns:
- The column
-
createColumn
Column createColumn(JavaTypeMapping mapping, String javaType, org.datanucleus.metadata.ColumnMetaData colmd)
Method to create a column in a container (table). To be used for serialised PC element/key/value in a join table.- Parameters:
mapping
- The java mappingjavaType
- The java typecolmd
- MetaData for the column to create- Returns:
- The column
-
createColumn
Column createColumn(org.datanucleus.metadata.AbstractMemberMetaData fmd, Table table, JavaTypeMapping mapping, org.datanucleus.metadata.ColumnMetaData colmd, Column referenceCol, org.datanucleus.ClassLoaderResolver clr)
Method to create a column for a persistable mapping.- Parameters:
fmd
- MetaData for the fieldtable
- Table in the datastoremapping
- The java mappingcolmd
- MetaData for the column to createreferenceCol
- The column to referenceclr
- ClassLoader resolver- Returns:
- The column
-
-