|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.mapped.mapping.AbstractMappingManager
public abstract class AbstractMappingManager
Base implementation of a MappingManager. Datastores should extend this to add their own specifics, and to add the initialisation of their supported types.
The idea behind a MappingManager is that at the Java side we have a series of Java type mappings, and at the datastore side we have a series of datastore type mappings. We need a link between the two to say that "this Java type can map to any of these 3 datastore types, and by default use this one".
| Nested Class Summary | |
|---|---|
protected class |
AbstractMappingManager.TypeMapping
|
| Field Summary | |
|---|---|
protected static Localiser |
LOCALISER
|
protected MappedStoreManager |
storeMgr
Store Manager that this relates to. |
| Constructor Summary | |
|---|---|
AbstractMappingManager(MappedStoreManager storeMgr)
Constructor for a mapping manager for an ORM datastore. |
|
| Method Summary | |
|---|---|
protected java.lang.Class |
getDefaultJavaTypeMapping(java.lang.Class javaType)
Method to return the default java type mapping class for a specified java type. |
protected java.lang.Class |
getElementMappingClass(DatastoreContainerObject container,
AbstractMemberMetaData mmd,
DatastoreAdapter dba,
ClassLoaderResolver clr)
Convenience accessor for the mapping class of the element mapping for a collection/array of elements. |
protected java.lang.Class |
getKeyMappingClass(DatastoreContainerObject container,
AbstractMemberMetaData mmd,
DatastoreAdapter dba,
ClassLoaderResolver clr)
Convenience accessor for the mapping class of the key mapping for a map of PC keys. |
JavaTypeMapping |
getMapping(java.lang.Class c)
Accessor for the mapping for the specified class. |
JavaTypeMapping |
getMapping(java.lang.Class c,
boolean serialised,
boolean embedded,
java.lang.String fieldName)
Accessor for the mapping for the specified class. |
JavaTypeMapping |
getMapping(DatastoreContainerObject datastoreContainer,
AbstractMemberMetaData fmd,
ClassLoaderResolver clr,
int fieldRole)
Accessor for the mapping for the field of the specified table. |
protected java.lang.Class |
getMappingClass(java.lang.Class c,
boolean serialised,
boolean embedded,
java.lang.String fieldName)
Accessor for the mapping class for the specified class. |
JavaTypeMapping |
getMappingWithDatastoreMapping(java.lang.Class c,
boolean serialised,
boolean embedded,
ClassLoaderResolver clr)
Accessor for the mapping for the specified class. |
protected java.lang.Class |
getOverrideMappingClass(java.lang.Class mappingClass,
AbstractMemberMetaData fmd,
int fieldRole)
Convenience method to allow overriding of particular mapping classes. |
protected java.lang.Class |
getValueMappingClass(DatastoreContainerObject container,
AbstractMemberMetaData mmd,
DatastoreAdapter dba,
ClassLoaderResolver clr)
Convenience accessor for the mapping class of the value mapping for a map of values. |
abstract void |
loadDatastoreMapping(PluginManager mgr,
ClassLoaderResolver clr,
java.lang.String vendorId)
Load all datastore mappings defined in the associated plugins. |
abstract void |
registerDatastoreMapping(java.lang.String javaTypeName,
java.lang.Class datastoreMappingType,
java.lang.String jdbcType,
java.lang.String sqlType,
boolean dflt)
Utility to register a datastore mapping for a java type, and the SQL/JDBC types it can be mapped to. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.datanucleus.store.mapped.mapping.MappingManager |
|---|
createDatastoreField, createDatastoreField, createDatastoreField, createDatastoreMapping, createDatastoreMapping |
| Field Detail |
|---|
protected static final Localiser LOCALISER
protected final MappedStoreManager storeMgr
| Constructor Detail |
|---|
public AbstractMappingManager(MappedStoreManager storeMgr)
storeMgr - The StoreManager| Method Detail |
|---|
public abstract void loadDatastoreMapping(PluginManager mgr,
ClassLoaderResolver clr,
java.lang.String vendorId)
loadDatastoreMapping in interface MappingManagermgr - the PluginManagerclr - the ClassLoaderResolvervendorId - the datastore vendor id
public JavaTypeMapping getMappingWithDatastoreMapping(java.lang.Class c,
boolean serialised,
boolean embedded,
ClassLoaderResolver clr)
getMappingWithDatastoreMapping in interface MappingManagerc - Java typeserialised - Whether the type is serialisedembedded - Whether the type is embeddedclr - ClassLoader resolver
public JavaTypeMapping getMapping(java.lang.Class c)
getMapping in interface MappingManagerc - Java type
public JavaTypeMapping getMapping(java.lang.Class c,
boolean serialised,
boolean embedded,
java.lang.String fieldName)
getMapping in interface MappingManagerc - Java typeserialised - Whether the type is serialisedembedded - Whether the type is embeddedfieldName - Name of the field (for logging)
public JavaTypeMapping getMapping(DatastoreContainerObject datastoreContainer,
AbstractMemberMetaData fmd,
ClassLoaderResolver clr,
int fieldRole)
getMapping in interface MappingManagerclr - The ClassLoaderResolverfieldRole - Role that this mapping plays for the fielddatastoreContainer - Table to add the mapping tofmd - FieldMetaData for the field to map
protected java.lang.Class getOverrideMappingClass(java.lang.Class mappingClass,
AbstractMemberMetaData fmd,
int fieldRole)
mappingClass - The mapping class selectedfmd - Field meta data for the field (if appropriate)fieldRole - Role for the field (e.g collection element)
protected java.lang.Class getMappingClass(java.lang.Class c,
boolean serialised,
boolean embedded,
java.lang.String fieldName)
c - Class to queryserialised - Whether the field is serialisedembedded - Whether the field is embeddedfieldName - The full field name (for logging only)
protected java.lang.Class getElementMappingClass(DatastoreContainerObject container,
AbstractMemberMetaData mmd,
DatastoreAdapter dba,
ClassLoaderResolver clr)
container - The containermmd - MetaData for the collection field/property containing the collection/array of PCsdba - Database adapterclr - ClassLoader resolver
protected java.lang.Class getKeyMappingClass(DatastoreContainerObject container,
AbstractMemberMetaData mmd,
DatastoreAdapter dba,
ClassLoaderResolver clr)
container - The containermmd - MetaData for the field containing the map that this key is fordba - Database adapterclr - ClassLoader resolver
protected java.lang.Class getValueMappingClass(DatastoreContainerObject container,
AbstractMemberMetaData mmd,
DatastoreAdapter dba,
ClassLoaderResolver clr)
container - The containermmd - MetaData for the field/property containing the map that this value is fordba - Database adapterclr - ClassLoader resolver
protected java.lang.Class getDefaultJavaTypeMapping(java.lang.Class javaType)
javaType - java type
public abstract void registerDatastoreMapping(java.lang.String javaTypeName,
java.lang.Class datastoreMappingType,
java.lang.String jdbcType,
java.lang.String sqlType,
boolean dflt)
registerDatastoreMapping in interface MappingManagerjavaTypeName - Name of the java typedatastoreMappingType - The datastore mappingjdbcType - The JDBC type that can be usedsqlType - The SQL type that can be useddflt - Whether this type should be used as the default mapping for this Java type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||