org.jpox.store.mapping
Class ArrayMapping

java.lang.Object
  extended byorg.jpox.store.mapping.JavaTypeMapping
      extended byorg.jpox.store.mapping.SingleFieldMapping
          extended byorg.jpox.store.mapping.AbstractContainerMapping
              extended byorg.jpox.store.mapping.ArrayMapping
All Implemented Interfaces:
MappingCallbacks
Direct Known Subclasses:
OracleArrayMapping

public class ArrayMapping
extends AbstractContainerMapping
implements MappingCallbacks

Mapping for an array.

Version:
$Revision: 1.11 $

Field Summary
 
Fields inherited from class org.jpox.store.mapping.AbstractContainerMapping
contentsStore, contentsTable, fieldName, instantiatedType, storeMgr
 
Fields inherited from class org.jpox.store.mapping.SingleFieldMapping
datastoreContainer, typeInfo
 
Fields inherited from class org.jpox.store.mapping.JavaTypeMapping
datastoreMappings, dba, fmd, LOCALISER, referenceMapping, type
 
Constructor Summary
ArrayMapping(DatastoreAdapter dba, AbstractPropertyMetaData fmd, DatastoreContainerObject datastoreContainer, ClassLoaderResolver clr)
          Creates a new ArrayMapping object.
ArrayMapping(DatastoreAdapter dba, java.lang.String type)
          Creates a new ArrayMapping object.
 
Method Summary
 void deleteDependent(StateManager sm)
          Method to delete all dependent objects (the contents of the array).
 boolean equals(java.lang.Object obj)
          Equality operator.
 ArrayStore getBackingStore(ClassLoaderResolver clr)
          Accessor for the Store of the contents.
 java.lang.Class getJavaType()
          Accessor for the Java type represented here.
 java.lang.Object getSampleValue()
          Accessor for a sample value for this mapping.
 ScalarExpression newLiteral(QueryExpression qs, java.lang.Object value)
          Accessor for a literal representing this type.
 ScalarExpression newScalarExpression(QueryExpression qs, LogicSetExpression te)
          Accessor for a scalar expression involving this object.
 void postFetch(StateManager sm)
          Method to be called after any fetch of the owner class element.
 void postInsert(StateManager sm)
          Method to be called after the insert of the owner class element.
 void postUpdate(StateManager sm)
          Method to be called after any update of the owner class element.
 void preDelete(StateManager sm)
          Method to be called before any delete of the owner class element, if the field in the owner is dependent
 
Methods inherited from class org.jpox.store.mapping.AbstractContainerMapping
containerIsStoredInSingleColumn, getDatastoreContainer, getDataStoreMapping, getDataStoreMappings, getNumberOfDatastoreFields, getObject, hashCode, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, newWrapper, prepareDatastoreMapping, setObject, validateElementForWriting, validateElementsForWriting
 
Methods inherited from class org.jpox.store.mapping.SingleFieldMapping
getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getShort, getString, hasValue, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString
 
Methods inherited from class org.jpox.store.mapping.JavaTypeMapping
addDataStoreMapping, failureMessage, getFieldMetaData, getObject, getReferenceMapping, getType, isNullable, setDefault, setObject, setReferenceMapping
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayMapping

public ArrayMapping(DatastoreAdapter dba,
                    java.lang.String type)
Creates a new ArrayMapping object.

Parameters:
dba - Datastore Adapter
type - Type of the field

ArrayMapping

public ArrayMapping(DatastoreAdapter dba,
                    AbstractPropertyMetaData fmd,
                    DatastoreContainerObject datastoreContainer,
                    ClassLoaderResolver clr)
Creates a new ArrayMapping object.

Parameters:
dba - Datastore Adapter
fmd - AbstractPropertyMetaData for the field to be mapped
datastoreContainer - Table containing the field
clr - The ClassLoaderResolver
Method Detail

equals

public boolean equals(java.lang.Object obj)
Equality operator.

Overrides:
equals in class SingleFieldMapping
Parameters:
obj - Object to compare against
Returns:
Whether they are equal

getJavaType

public java.lang.Class getJavaType()
Accessor for the Java type represented here.

Specified by:
getJavaType in class JavaTypeMapping
Returns:
The java type

getSampleValue

public java.lang.Object getSampleValue()
Accessor for a sample value for this mapping.

Overrides:
getSampleValue in class AbstractContainerMapping
Returns:
The sample value

getBackingStore

public ArrayStore getBackingStore(ClassLoaderResolver clr)
Accessor for the Store of the contents.

Parameters:
clr - The ClassLoaderResolver
Returns:
The backing store

postInsert

public void postInsert(StateManager sm)
Method to be called after the insert of the owner class element.

Specified by:
postInsert in interface MappingCallbacks
Parameters:
sm - StateManager of the owner

postFetch

public void postFetch(StateManager sm)
Method to be called after any fetch of the owner class element.

Specified by:
postFetch in interface MappingCallbacks
Overrides:
postFetch in class AbstractContainerMapping
Parameters:
sm - StateManager of the owner

postUpdate

public void postUpdate(StateManager sm)
Method to be called after any update of the owner class element.

Specified by:
postUpdate in interface MappingCallbacks
Parameters:
sm - StateManager of the owner

preDelete

public void preDelete(StateManager sm)
Method to be called before any delete of the owner class element, if the field in the owner is dependent

Specified by:
preDelete in interface MappingCallbacks
Parameters:
sm - StateManager of the owner

deleteDependent

public void deleteDependent(StateManager sm)
Method to delete all dependent objects (the contents of the array).

Specified by:
deleteDependent in interface MappingCallbacks
Parameters:
sm - State Manager of the owner

newLiteral

public ScalarExpression newLiteral(QueryExpression qs,
                                   java.lang.Object value)
Accessor for a literal representing this type.

Specified by:
newLiteral in class JavaTypeMapping
Parameters:
qs - The Query
value - the value of this object in the literal
Returns:
The literal

newScalarExpression

public ScalarExpression newScalarExpression(QueryExpression qs,
                                            LogicSetExpression te)
Accessor for a scalar expression involving this object.

Specified by:
newScalarExpression in class JavaTypeMapping
Parameters:
qs - The Query
te - The table holding this object.
Returns:
The expression


Copyright © -2007 . All Rights Reserved.