org.datanucleus.store.mapped.mapping
Class TemporalMapping

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.TemporalMapping
Direct Known Subclasses:
DateMapping, SqlDateMapping, SqlTimeMapping, SqlTimestampMapping

public abstract class TemporalMapping
extends SingleFieldMapping

Abstract base mapping for all temporal types.


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type
 
Constructor Summary
TemporalMapping()
           
 
Method Summary
 int getDefaultLength(int index)
          Method to return the default length of this type in the datastore.
protected abstract  int getDefaultLengthAsString()
           
 java.lang.String getJavaTypeForDatastoreMapping(int index)
          Accessor for the name of the java-type actually used when mapping the particular datastore field.
 ScalarExpression newScalarExpression(QueryExpression qs, LogicSetExpression te)
          Creates a expression from a field name/table.
 
Methods inherited from class org.datanucleus.store.mapped.mapping.SingleFieldMapping
equals, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getObject, getShort, getString, getValidValues, initialize, prepareDatastoreMapping, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setObject, setShort, setString
 
Methods inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
addDatastoreMapping, failureMessage, getColumnMetaDataForMember, getDatastoreContainer, getDatastoreMapping, getDatastoreMappings, getJavaType, getMemberMetaData, getNumberOfDatastoreMappings, getObject, getReferenceMapping, getRoleForMember, getSampleValue, getType, getValueForDatastoreMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, newLiteral, setDatastoreContainer, setDefault, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemporalMapping

public TemporalMapping()
Method Detail

getDefaultLength

public int getDefaultLength(int index)
Method to return the default length of this type in the datastore.

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

getDefaultLengthAsString

protected abstract int getDefaultLengthAsString()

getJavaTypeForDatastoreMapping

public java.lang.String getJavaTypeForDatastoreMapping(int index)
Accessor for the name of the java-type actually used when mapping the particular datastore field. This java-type must have an entry in the datastore mappings.

Overrides:
getJavaTypeForDatastoreMapping in class SingleFieldMapping
Parameters:
index - requested datastore field index.
Returns:
the name of java-type for the requested datastore field.

newScalarExpression

public ScalarExpression newScalarExpression(QueryExpression qs,
                                            LogicSetExpression te)
Description copied from class: JavaTypeMapping
Creates a expression from a field name/table. e.g. tablename.fieldname; tablealias.fieldalias For use in TJDO-style JDOQL. This implementation just throws a NucleusException.

Overrides:
newScalarExpression in class JavaTypeMapping
Parameters:
qs - The Query statement
te - the alias for the table
Returns:
A Scalar Expression TODO Remove this when we drop legacy query mechanism


Copyright © 2010. All Rights Reserved.