|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kodo.meta.DelegatingExtensions | +--kodo.meta.DelegatingFieldMetaData | +--kodo.jdbc.meta.AbstractFieldMapping | +--kodo.jdbc.meta.ReferenceFieldMapping
Base class of most field mappings. Maps a value that might be in a table other than the owning class' table, and manages the reference foreign key linking to the parent table (if such a key exists).
Fields inherited from interface kodo.jdbc.meta.JDBCTypes |
TYPE_ASCII_STREAM, TYPE_BINARY_STREAM, TYPE_BLOB, TYPE_BYTES, TYPE_CHAR_STREAM, TYPE_CLOB, TYPE_JDBC_DEFAULT, TYPE_REF, TYPE_SQL_ARRAY, TYPE_SQL_DATE, TYPE_SQL_OBJECT, TYPE_TIME, TYPE_TIMESTAMP |
Fields inherited from interface kodo.meta.JDOTypes |
TYPE_ARRAY, TYPE_BIGDECIMAL, TYPE_BIGINTEGER, TYPE_BOOLEAN, TYPE_BOOLEAN_OBJ, TYPE_BYTE, TYPE_BYTE_OBJ, TYPE_CHAR, TYPE_CHAR_OBJ, TYPE_COLLECTION, TYPE_DATE, TYPE_DOUBLE, TYPE_DOUBLE_OBJ, TYPE_FCO, TYPE_FLOAT, TYPE_FLOAT_OBJ, TYPE_INT, TYPE_INT_OBJ, TYPE_LOCALE, TYPE_LONG, TYPE_LONG_OBJ, TYPE_MAP, TYPE_NUMBER, TYPE_OBJECT, TYPE_PC_OBJECT, TYPE_SHORT, TYPE_SHORT_OBJ, TYPE_STRING |
Fields inherited from interface kodo.jdbc.meta.FieldMapping |
AUTO_INCREMENT, DELETE_ACTION, ELEMENT_DELETE_ACTION, ELEMENT_INDEXED, ELEMENT_SIZE, EXTENSION_KEYS, FIELD_MAP, INDEXED, JDBC_TYPE, KEY_DELETE_ACTION, KEY_INDEXED, KEY_SIZE, REF_DELETE_ACTION, REF_INDEXED, SIZE, SQL_TYPE, VALUE_DELETE_ACTION, VALUE_INDEXED, VALUE_SIZE |
Fields inherited from interface kodo.meta.FieldMetaData |
DEPENDENT, EAGER_FETCH_MODE, ELEMENT_DEPENDENT, ELEMENT_TYPE, EXTERNAL_VALUES, EXTERNALIZER, FACTORY, FETCH_GROUP, INVERSE_LOGICAL, INVERSE_OWNER, KEY_DEPENDENT, KEY_TYPE, LOCK_GROUP, LOCK_GROUP_DEFAULT, LOCK_GROUP_NONE, LRS, MANAGE_NONE, MANAGE_PERSISTENT, MANAGE_TRANSACTIONAL, NULL_DEFAULT, NULL_EXCEPTION, NULL_NONE, NULL_UNSET, SEQUENCE_ASSIGNED, TYPE, VALUE_DEPENDENT, VALUE_TYPE |
Constructor Summary | |
ReferenceFieldMapping(FieldMetaData meta)
Constructor. |
Method Summary | |
void |
addMappingInfoAttributes(Collection attrs)
Add all mapping attributes names used by this mapping to the given collection. |
protected void |
createRefForeignKey(Table table)
Creates the reference foreign key on the given secondary table. |
void |
delete(KodoStateManager sm,
RowManager rm)
Delete the row for this object if the reference foreign key exists. |
protected void |
fromMappingInfo(MappingInfo info,
boolean adapt,
boolean fkRequired)
|
protected Row |
getJoinedRow(RowManager rm,
int action,
KodoStateManager sm,
boolean nullEmbedded)
Return the row to use for this field. |
ForeignKey |
getRefForeignKey()
Return the foreign key linking this mapping to the parent table. |
protected Joins |
getRefJoins(Select sel)
Return any joins needed to get from the primary table to this table. |
int |
getRefJoinType()
Return the reference join type. |
Table |
getTable()
Return the mapping's primary data table. |
protected Joins |
join(Joins joins,
boolean toMany)
Joins from the owning class' table to the table where this field lies using the reference foreign key. |
void |
refSchemaComponents()
Increment the reference count of all used schema components. |
void |
setRefForeignKey(ForeignKey fk)
Set the foreign key linking this mapping to the parent table. |
protected void |
setRefForeignKey(KodoStateManager sm,
Row row)
Set the reference foreign key if it exists. |
void |
setRefJoinType(int joinType)
Set the reference join type. |
void |
toMappingInfo(MappingInfo info)
Serialize this mapping to a simple MappingInfo instance
for transfer to XML or some other format. |
protected void |
wherePrimaryKey(Select sel,
KodoStateManager sm)
Add a wherePrimaryKey or whereForeignKey
condition to the given select, depending on whether we have a reference
foreign key. |
protected void |
whereRefForeignKey(KodoStateManager sm,
Row row)
Add a WHERE condition matching the reference foreign key to the given value on the given row. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface kodo.jdbc.meta.Mapping |
getMappingType, insert, map, update |
Methods inherited from interface kodo.jdbc.meta.FieldMapping |
appendIsNotNull, appendIsNull, getColumns, load, load, loadProjection, select |
Methods inherited from interface java.lang.Comparable |
compareTo |
Methods inherited from interface kodo.meta.Commentable |
getComments |
Constructor Detail |
public ReferenceFieldMapping(FieldMetaData meta)
Method Detail |
public ForeignKey getRefForeignKey()
public void setRefForeignKey(ForeignKey fk)
public int getRefJoinType()
public void setRefJoinType(int joinType)
public Table getTable()
Mapping
public void toMappingInfo(MappingInfo info)
Mapping
MappingInfo
instance
for transfer to XML or some other format.protected void fromMappingInfo(MappingInfo info, boolean adapt, boolean fkRequired)
public void addMappingInfoAttributes(Collection attrs)
Mapping
addMappingInfoAttributes
in class AbstractFieldMapping
public void refSchemaComponents()
Mapping
protected void createRefForeignKey(Table table)
protected Joins join(Joins joins, boolean toMany)
protected Joins getRefJoins(Select sel)
protected void wherePrimaryKey(Select sel, KodoStateManager sm)
wherePrimaryKey
or whereForeignKey
condition to the given select, depending on whether we have a reference
foreign key.protected Row getJoinedRow(RowManager rm, int action, KodoStateManager sm, boolean nullEmbedded) throws SQLException
Join.TYPE_OUTER
,
and if so it deletes the field's previous value, then if the field is
non-null returns an insert row for the new value. The reference
foreign key will already be set on the returned row; subclass mappings
just need to set their own values.nullEmbedded
- true if the row is being used to null an
embedded valueprotected void setRefForeignKey(KodoStateManager sm, Row row) throws SQLException
protected void whereRefForeignKey(KodoStateManager sm, Row row) throws SQLException
public void delete(KodoStateManager sm, RowManager rm) throws SQLException
kodo.jdbc.meta.Mapping
Mapping.insert(kodo.runtime.KodoStateManager, kodo.jdbc.sql.RowManager)
|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |