|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.store.mapped.mapping.JavaTypeMapping
org.jpox.store.mapped.mapping.MultiMapping
org.jpox.store.mapped.mapping.ReferenceMapping
public abstract class ReferenceMapping
Mapping for a reference type. This can be used for things like interfaces, or Object which are simply a reference to some specific (PersistenceCapable) class. All fields of this type have a list of possible "implementations" of the reference type. A column is created for each possible implementation of the reference as a FK to the implementation table.
| Field Summary |
|---|
| Fields inherited from class org.jpox.store.mapped.mapping.MultiMapping |
|---|
javaTypeMappings |
| Fields inherited from class org.jpox.store.mapped.mapping.JavaTypeMapping |
|---|
datastoreContainer, datastoreMappings, dba, fmd, LOCALISER, MAPPING_ARRAY_ELEMENT, MAPPING_COLLECTION_ELEMENT, MAPPING_FIELD, MAPPING_MAP_KEY, MAPPING_MAP_VALUE, referenceMapping, roleForField, type |
| Constructor Summary | |
|---|---|
ReferenceMapping()
|
|
| Method Summary | |
|---|---|
protected void |
createColumns(DatastoreContainerObject datastoreContainer,
AbstractMemberMetaData fmd,
ClassLoaderResolver clr)
Convenience method to create a column for each implementation type of this reference. |
java.lang.Class |
getJavaType()
Accessor for the java type being mapped. |
java.lang.Object |
getSampleValue(ClassLoaderResolver clr)
Return a sample value of the mapping type to be used for internal evaluation of type and conversion. |
void |
initialize(DatastoreAdapter dba,
AbstractMemberMetaData fmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
Initialize this JavaTypeMapping with the given DatastoreAdapter for the given FieldMetaData. |
ScalarExpression |
newLiteral(QueryExpression qs,
java.lang.Object value)
Creates a literal from an value. |
ScalarExpression |
newScalarExpression(QueryExpression qs,
LogicSetExpression te)
Creates a expression from a field name/table. |
void |
postFetch(StateManager sm)
Method executed just after a fetch of the owning object, allowing any necessary action to this field and the object stored in it. |
void |
postInsert(StateManager sm)
Method executed just after the insert of the owning object, allowing any necessary action to this field and the object stored in it. |
void |
postUpdate(StateManager sm)
Method executed just afer any update of the owning object, allowing any necessary action to this field and the object stored in it. |
void |
preDelete(StateManager sm)
Method executed just before the owning object is deleted, allowing tidying up of any relation information. |
| Methods inherited from class org.jpox.store.mapped.mapping.MultiMapping |
|---|
addJavaTypeMapping, getDataStoreMapping, getJavaTypeMapping, getNumberOfDatastoreFields, getObject, setObject, setObject |
| Methods inherited from class org.jpox.store.mapped.mapping.JavaTypeMapping |
|---|
addDataStoreMapping, failureMessage, getBoolean, getByte, getChar, getDatastoreContainer, getDataStoreMappings, getDouble, getFieldMetaData, getFloat, getInt, getJavaTypeForDatastoreMapping, getLong, getObject, getReferenceMapping, getRoleForField, getShort, getString, getType, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, setBoolean, setByte, setChar, setDefault, setDouble, setFieldInformation, setFloat, setInt, setLong, setReferenceMapping, setRoleForField, setShort, setString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReferenceMapping()
| Method Detail |
|---|
public void initialize(DatastoreAdapter dba,
AbstractMemberMetaData fmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
initialize in class JavaTypeMappingdba - The Datastore Adapter that this Mapping should use.fmd - FieldMetaData for the field to be mapped (if any)container - The datastore container storing this mapping (if any)clr - the ClassLoaderResolver
protected void createColumns(DatastoreContainerObject datastoreContainer,
AbstractMemberMetaData fmd,
ClassLoaderResolver clr)
datastoreContainer - Table to usefmd - MetaData for the fieldclr - The ClassLoaderResolverpublic java.lang.Class getJavaType()
JavaTypeMapping
getJavaType in class JavaTypeMappingpublic java.lang.Object getSampleValue(ClassLoaderResolver clr)
JavaTypeMapping
getSampleValue in class JavaTypeMappingclr - TODO
public ScalarExpression newLiteral(QueryExpression qs,
java.lang.Object value)
JavaTypeMapping
newLiteral in class JavaTypeMappingqs - The Query statementvalue - The object
public ScalarExpression newScalarExpression(QueryExpression qs,
LogicSetExpression te)
JavaTypeMapping
newScalarExpression in class JavaTypeMappingqs - The Query statementte - the alias for the table
public void postFetch(StateManager sm)
postFetch in interface MappingCallbackssm - StateManager for the owner.public void postInsert(StateManager sm)
postInsert in interface MappingCallbackssm - StateManager for the ownerpublic void postUpdate(StateManager sm)
postUpdate in interface MappingCallbackssm - StateManager for the ownerpublic void preDelete(StateManager sm)
preDelete in interface MappingCallbackssm - StateManager for the owner
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||