org.datanucleus.store.mapped.mapping
Class CurrencyMapping

java.lang.Object
  extended by org.datanucleus.store.mapped.mapping.JavaTypeMapping
      extended by org.datanucleus.store.mapped.mapping.SingleFieldMapping
          extended by org.datanucleus.store.mapped.mapping.ObjectAsStringMapping
              extended by org.datanucleus.store.mapped.mapping.CurrencyMapping

public class CurrencyMapping
extends ObjectAsStringMapping

SCO Mapping for Currency type.


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type
 
Constructor Summary
CurrencyMapping()
           
 
Method Summary
 int getDefaultLength(int index)
          Method to return the default length of this type in the datastore.
 java.lang.Class getJavaType()
          Method to return the Java type.
protected  java.lang.String objectToString(java.lang.Object object)
          Method to set the datastore string value based on the object value.
protected  java.lang.Object stringToObject(java.lang.String datastoreValue)
          Method to extract the objects value from the datastore string value.
 
Methods inherited from class org.datanucleus.store.mapped.mapping.ObjectAsStringMapping
getJavaTypeForDatastoreMapping, getObject, setObject
 
Methods inherited from class org.datanucleus.store.mapped.mapping.SingleFieldMapping
equals, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getShort, getString, getValidValues, initialize, prepareDatastoreMapping, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString
 
Methods inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
addDatastoreMapping, failureMessage, getColumnMetaDataForMember, getDatastoreContainer, getDatastoreMapping, getDatastoreMappings, getMemberMetaData, getNumberOfDatastoreMappings, getObject, getReferenceMapping, getRoleForMember, getType, getValueForDatastoreMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, setDatastoreContainer, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrencyMapping

public CurrencyMapping()
Method Detail

getJavaType

public java.lang.Class getJavaType()
Description copied from class: ObjectAsStringMapping
Method to return the Java type.

Specified by:
getJavaType in class ObjectAsStringMapping
Returns:
The Java type being represented.

getDefaultLength

public int getDefaultLength(int index)
Method to return the default length of this type in the datastore. ISO4217 currencies use 3 character codes, so return 3.

Overrides:
getDefaultLength in class SingleFieldMapping
Parameters:
index - The index position
Returns:
The default length

objectToString

protected java.lang.String objectToString(java.lang.Object object)
Method to set the datastore string value based on the object value.

Specified by:
objectToString in class ObjectAsStringMapping
Parameters:
object - The object
Returns:
The string value to pass to the datastore

stringToObject

protected java.lang.Object stringToObject(java.lang.String datastoreValue)
Method to extract the objects value from the datastore string value.

Specified by:
stringToObject in class ObjectAsStringMapping
Parameters:
datastoreValue - Value obtained from the datastore
Returns:
The value of this object (derived from the datastore string value)


Copyright © 2011. All Rights Reserved.