|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.store.mapping.JavaTypeMapping
org.jpox.store.mapping.SingleFieldMapping
org.jpox.store.mapping.DiscriminatorMapping
Mapping for a discriminator column in a table used in inheritance. The discriminator column is, by default, a String type, typically VARCHAR. It can however be "long" based if the user specifies INTEGER, BIGINT, or NUMERIC as the jdbc-type. In the latter case we make the necessary conversions between value types in this mapping class. This class is for internal use only. It should not be used in user mappings nor extended.
Field Summary |
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 | |
DiscriminatorMapping(DatastoreAdapter dba,
DatastoreContainerObject datastoreContainer,
JavaTypeMapping delegate)
Constructor. |
Method Summary | |
void |
addDataStoreMapping(DatastoreMapping datastoreMapping)
Mutator to add a datastore mapping |
DatastoreMapping |
getDataStoreMapping(int index)
Accessor for a datastore mapping |
java.lang.Class |
getJavaType()
Accessor for the type represented here, returning the class itself |
int |
getNumberOfDatastoreFields()
Accessor for the number of datastore fields. |
java.lang.Object |
getObject(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Accessor for the object in this column |
java.lang.Object |
getSampleValue()
Accessor for a sample value for this type. |
ScalarExpression |
newLiteral(QueryExpression qs,
java.lang.Object value)
Accessor for a new literal for this mapping. |
ScalarExpression |
newScalarExpression(QueryExpression qs,
LogicSetExpression te)
Accessor for a new scalar expression including this mapping. |
void |
setObject(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
java.lang.Object value)
Mutator for the object in this column |
Methods inherited from class org.jpox.store.mapping.SingleFieldMapping |
equals, getBoolean, getByte, getChar, getDatastoreContainer, getDouble, getFloat, getInt, getLong, getShort, getString, hasValue, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, prepareDatastoreMapping, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString |
Methods inherited from class org.jpox.store.mapping.JavaTypeMapping |
failureMessage, getDataStoreMappings, getFieldMetaData, getObject, getReferenceMapping, getType, isNullable, setDefault, setObject, setReferenceMapping |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DiscriminatorMapping(DatastoreAdapter dba, DatastoreContainerObject datastoreContainer, JavaTypeMapping delegate)
dba
- Datastore AdapterdatastoreContainer
- Datastore tabledelegate
- The JavaTypeMapping to delegate storageMethod Detail |
public java.lang.Class getJavaType()
getJavaType
in class JavaTypeMapping
public java.lang.Object getSampleValue()
getSampleValue
in class JavaTypeMapping
public ScalarExpression newLiteral(QueryExpression qs, java.lang.Object value)
newLiteral
in class JavaTypeMapping
qs
- The QueryStatementvalue
- The value of the object
public ScalarExpression newScalarExpression(QueryExpression qs, LogicSetExpression te)
newScalarExpression
in class JavaTypeMapping
qs
- The QueryStatementte
- The table Expression
public void setObject(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, java.lang.Object value)
setObject
in class SingleFieldMapping
pm
- The Persistence ManagerpreparedStatement
- The statementexprIndex
- The indexesvalue
- The value to set it topublic java.lang.Object getObject(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
getObject
in class SingleFieldMapping
pm
- The Persistence managerresultSet
- The ResultSet to get the value fromexprIndex
- The indexes
public int getNumberOfDatastoreFields()
getNumberOfDatastoreFields
in class JavaTypeMapping
public DatastoreMapping getDataStoreMapping(int index)
getDataStoreMapping
in class JavaTypeMapping
index
- Index of the mapping
public void addDataStoreMapping(DatastoreMapping datastoreMapping)
addDataStoreMapping
in class JavaTypeMapping
datastoreMapping
- Datastore mapping
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |