org.datanucleus.store.mapped.mapping
Class QuadCurve2dDoubleMapping

java.lang.Object
  extended by org.datanucleus.store.mapped.mapping.JavaTypeMapping
      extended by org.datanucleus.store.mapped.mapping.SingleFieldMultiMapping
          extended by org.datanucleus.store.mapped.mapping.QuadCurve2dDoubleMapping

public class QuadCurve2dDoubleMapping
extends SingleFieldMultiMapping

Mapping for java.awt.geom.QuadCurve2D.Double, maps the x1, y1, ctrlx, ctrly, x2 and y2 values to double-precision datastore fields.


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type
 
Constructor Summary
QuadCurve2dDoubleMapping()
           
 
Method Summary
protected  void addDatastoreFields()
           
 java.lang.Class getJavaType()
          Accessor for the java type being mapped.
 java.lang.Object getObject(ExecutionContext ec, java.lang.Object resultSet, int[] exprIndex)
          Obtains a value from datastoreResults at position specified by exprIndex.
 java.lang.Object getSampleValue(ClassLoaderResolver clr)
          Return a sample value of the mapping type to be used for internal evaluation of type/conversion.
 java.lang.Object getValueForDatastoreMapping(OMFContext omfCtx, int index, java.lang.Object value)
          Method to return the value to be stored in the specified datastore index given the overall value for this java type.
 void initialize(AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr)
          Initialize this JavaTypeMapping for the supplied table and field/property metadata.
 void initialize(MappedStoreManager storeMgr, java.lang.String type)
          Initialize this JavaTypeMapping with the given StoreManager for the given type.
 void setObject(ExecutionContext ec, java.lang.Object preparedStatement, int[] exprIndex, java.lang.Object value)
          Sets a value into datastoreStatement at position specified by exprIndex.
 
Methods inherited from class org.datanucleus.store.mapped.mapping.SingleFieldMultiMapping
addDatastoreField, getJavaTypeForDatastoreMapping, hasSimpleDatastoreRepresentation
 
Methods inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
addDatastoreMapping, equals, failureMessage, getBoolean, getByte, getChar, getColumnMetaDataForMember, getDatastoreContainer, getDatastoreMapping, getDatastoreMappings, getDouble, getFloat, getInt, getLong, getMemberMetaData, getNumberOfDatastoreMappings, getObject, getReferenceMapping, getRoleForMember, getShort, getString, getType, hashCode, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, isNullable, isSerialised, newLiteral, newScalarExpression, setBoolean, setByte, setChar, setDatastoreContainer, setDefault, setDouble, setFloat, setInt, setLong, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember, setShort, setString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuadCurve2dDoubleMapping

public QuadCurve2dDoubleMapping()
Method Detail

initialize

public void initialize(AbstractMemberMetaData fmd,
                       DatastoreContainerObject container,
                       ClassLoaderResolver clr)
Description copied from class: JavaTypeMapping
Initialize this JavaTypeMapping for the supplied table and field/property metadata. Subclasses should override this method to perform any datastore initialization operations. Assumes the "roleForMember" is already set

Overrides:
initialize in class JavaTypeMapping
Parameters:
fmd - MetaData for the field/property to be mapped (if any)
container - The datastore container storing this mapping (if any)
clr - the ClassLoaderResolver

initialize

public void initialize(MappedStoreManager storeMgr,
                       java.lang.String type)
Description copied from class: JavaTypeMapping
Initialize this JavaTypeMapping with the given StoreManager for the given type. Used when the mapping is for a parameter in a query. This will not set the "mmd" and "datastoreContainer" parameters. If these are required for usage of the mapping then you should call "setFieldInformation(AbstractMemberMetaData, DatastoreContainerObject)" below Subclasses should override this method to perform any datastore initialization operations.

Overrides:
initialize in class JavaTypeMapping
Parameters:
storeMgr - The Datastore Adapter that this Mapping should use.
type - The Class that this mapping maps to the database.
See Also:
MappingFactory.createMapping(Class, MappedStoreManager, String)

addDatastoreFields

protected void addDatastoreFields()

getJavaType

public java.lang.Class getJavaType()
Description copied from class: JavaTypeMapping
Accessor for the java type being mapped. This is the java type that the mapping represents. Some examples : The "java type" is the java-type name used in the plugin.xml mapping file

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

getSampleValue

public java.lang.Object getSampleValue(ClassLoaderResolver clr)
Description copied from class: JavaTypeMapping
Return a sample value of the mapping type to be used for internal evaluation of type/conversion. TODO Delete when we drop legacy support

Overrides:
getSampleValue in class JavaTypeMapping
Parameters:
clr - ClassLoader resolver
Returns:
The sample value.

getValueForDatastoreMapping

public java.lang.Object getValueForDatastoreMapping(OMFContext omfCtx,
                                                    int index,
                                                    java.lang.Object value)
Method to return the value to be stored in the specified datastore index given the overall value for this java type.

Overrides:
getValueForDatastoreMapping in class JavaTypeMapping
Parameters:
index - The datastore index
value - The overall value for this java type
omfCtx - OMF Context
Returns:
The value for this datastore index

setObject

public void setObject(ExecutionContext ec,
                      java.lang.Object preparedStatement,
                      int[] exprIndex,
                      java.lang.Object value)
Description copied from class: JavaTypeMapping
Sets a value into datastoreStatement at position specified by exprIndex.

Overrides:
setObject in class JavaTypeMapping
Parameters:
ec - ExecutionContext
preparedStatement - a datastore object that executes statements in the database
exprIndex - the position of the value in the statement
value - the value

getObject

public java.lang.Object getObject(ExecutionContext ec,
                                  java.lang.Object resultSet,
                                  int[] exprIndex)
Description copied from class: JavaTypeMapping
Obtains a value from datastoreResults at position specified by exprIndex.

Overrides:
getObject in class JavaTypeMapping
Parameters:
ec - ExecutionContext
resultSet - an object returned from the datastore with values
exprIndex - the position of the value in the result
Returns:
the value


Copyright © 2010. All Rights Reserved.