|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.triactive.jdo.store.mapping.Mapping com.triactive.jdo.store.mapping.ColumnMapping com.triactive.jdo.store.mapping.OIDMapping com.triactive.jdo.store.mapping.ObjectDatastoreIdMapping
A column mapping that maps a first-class persistent object to a single column via its datastore ID value.
Although the mapping is ostensibly for the entire object, the result of getObject() and setObject() is to transfer only the value of its ID column to/from the PreparedStatement/ResultSet.
Field Summary |
Fields inherited from class com.triactive.jdo.store.mapping.ColumnMapping |
col, typeInfo |
Fields inherited from class com.triactive.jdo.store.mapping.Mapping |
dba, fmd, type |
Constructor Summary | |
ObjectDatastoreIdMapping(DatabaseAdapter dba,
java.lang.Class type)
Constructs a new object datastore ID mapping for a given Java type. |
Method Summary | |
void |
defineConstraints(BaseTable table,
StoreManager.MgmtTransaction mtx)
Causes the mapping object to define whatever constraints it needs on its backing storage, relative to the specified table. |
void |
defineStorage(Table table,
StoreManager.MgmtTransaction mtx)
Causes the mapping object to define whatever backing storage it needs, relative to the specified table. |
java.lang.Object |
getObject(PersistenceManager pm,
java.sql.ResultSet rs,
int param)
|
java.lang.Object |
getObject(PersistenceManager pm,
java.sql.ResultSet rs,
int columnIndex,
int[] fieldNumbers,
FieldManager fieldManager)
Gets the value of the designated column in the current row of a ResultSet object as a Java object. |
SqlExpression |
newSqlExpression(QueryStatement.QueryColumn qsc)
Returns an SQL expression representing a reference to a column in a query statement. |
SqlExpression |
newSqlLiteral(QueryStatement qs,
java.lang.Object value)
Returns an SQL expression representing the literal value of a Java object. |
void |
setObject(PersistenceManager pm,
java.sql.PreparedStatement ps,
int param,
java.lang.Object value)
|
Methods inherited from class com.triactive.jdo.store.mapping.OIDMapping |
mapTo |
Methods inherited from class com.triactive.jdo.store.mapping.ColumnMapping |
accessAsFieldIn, chooseColumnType, equals, getBoolean, getByte, getChar, getColumn, getDouble, getFloat, getInt, getLong, getShort, getSqlInsertionValue, getSqlUpdateValue, getString, getTypeInfo, hashCode, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString |
Methods inherited from class com.triactive.jdo.store.mapping.Mapping |
getDefaultMappingsByType, getFieldMetaData, getType |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ObjectDatastoreIdMapping(DatabaseAdapter dba, java.lang.Class type)
dba
- the database adaptertype
- the Java class that this mapping maps to the databaseMethod Detail |
public void defineStorage(Table table, StoreManager.MgmtTransaction mtx)
Overrides the superclass implementation and defines an ID column whose name is based on the name of the table. If this name collides with an existing column it uses a name based on the word "this", i.e. "THIS_ID".
The new column is then defined as the table's primary key.
defineStorage
in class ColumnMapping
table
- the table relative to which storage should be defined.public void defineConstraints(BaseTable table, StoreManager.MgmtTransaction mtx)
If the table has a supertable then a foreign key is defined from the table's primary key to its supertable's primary key.
defineConstraints
in class ColumnMapping
table
- the table relative to which constraints should be defined.public void setObject(PersistenceManager pm, java.sql.PreparedStatement ps, int param, java.lang.Object value)
setObject
in class OIDMapping
public java.lang.Object getObject(PersistenceManager pm, java.sql.ResultSet rs, int param)
getObject
in class OIDMapping
public java.lang.Object getObject(PersistenceManager pm, java.sql.ResultSet rs, int columnIndex, int[] fieldNumbers, FieldManager fieldManager)
ResultSet.getObject()
but may perform
additional processing specific to this mapping.
This method is equivalent to getObject(PersistenceManager,ResultSet,int)
but offers additional field values for the object to the PersistenceManager.
These usually come from other columns in the ResultSet.
pm
- the persistence manager to users
- the result set from which to take datacolumnIndex
- the first column is 1, the second is 2, ...fieldNumbers
- field numbers of additional available field valuesfieldManager
- a field manager from which to take the additional fieldspublic SqlExpression newSqlLiteral(QueryStatement qs, java.lang.Object value)
Mapping
newSqlLiteral
in class Mapping
qs
- the surrounding query statement for the expressionvalue
- the literal valuepublic SqlExpression newSqlExpression(QueryStatement.QueryColumn qsc)
ColumnMapping
newSqlExpression
in class ColumnMapping
qsc
- the query column reference
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |