SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

kodo.jdbc.meta
Class DelegatingJoinableMapping

java.lang.Object
  |
  +--kodo.jdbc.meta.DelegatingJoinableMapping
All Implemented Interfaces:
JoinableMapping

public class DelegatingJoinableMapping
extends Object
implements JoinableMapping

Delegates to another JoinableMapping after doing column translation. Useful for joins that are not managed by any fields on the joined-from side. For example, a vertical class mapping manages foreign key columns linking to the superclass table. It needs to use the joinable field mappings of the superclass to actually extract the column values from field values and so forth, but in order for other mapping to join to its foreign key columns it needs joinable mappings of its own. So it creates delegating mappings.


Constructor Summary
DelegatingJoinableMapping(JoinableMapping join, ForeignKey fk)
          Constructor.
 
Method Summary
 Column[] getColumns()
          Return this mapping's columns.
 FieldMapping getFieldMapping()
          Return the field mapping that owns this mapping's columns.
 int getJoinTypeCode(Column col)
          Return the type code from JDBCTypes of the JDBC value returned from calls to getJoinValue(kodo.jdbc.sql.Result, kodo.jdbc.schema.Column[], kodo.jdbc.schema.ForeignKey, kodo.jdbc.sql.Joins) for the given column.
 Object getJoinValue(Object fieldVal, Column col)
          Return the join value of the given column.
 Object getJoinValue(Result res, Column[] cols, ForeignKey fk, Joins joins)
          Return the value for this mapping from the given result, using the given columns.
 void setAutoIncrementValue(KodoStateManager sm, Column col, long autoInc)
          Use the given auto-incremented value to set this join value's field on the given instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingJoinableMapping

public DelegatingJoinableMapping(JoinableMapping join,
                                 ForeignKey fk)
Constructor.
Parameters:
join - the mapping to delegate to
fk - the foreign key to use to translate any given columns to the given delegate's columns
Method Detail

getColumns

public Column[] getColumns()
Description copied from interface: JoinableMapping
Return this mapping's columns.
Specified by:
getColumns in interface JoinableMapping

getFieldMapping

public FieldMapping getFieldMapping()
Description copied from interface: JoinableMapping
Return the field mapping that owns this mapping's columns. If this is a delegate mapping, return the field mapping of the delegate.
Specified by:
getFieldMapping in interface JoinableMapping

getJoinValue

public Object getJoinValue(Result res,
                           Column[] cols,
                           ForeignKey fk,
                           Joins joins)
                    throws SQLException
Description copied from interface: JoinableMapping
Return the value for this mapping from the given result, using the given columns. Outside code will always call this method with the cols array from JoinableMapping.getColumns(), but delegates may change the columns to use. If the given foreign key is non-null, use the foreign key's columns by translating the given columns through ForeignKey.getColumn(kodo.jdbc.schema.Column).
Specified by:
getJoinValue in interface JoinableMapping

getJoinValue

public Object getJoinValue(Object fieldVal,
                           Column col)
Description copied from interface: JoinableMapping
Return the join value of the given column.
Specified by:
getJoinValue in interface JoinableMapping
Following copied from interface: kodo.jdbc.meta.JoinableMapping
Parameters:
val - the value of the field for this mapping
col - the column of this mapping whose value to return

getJoinTypeCode

public int getJoinTypeCode(Column col)
Description copied from interface: JoinableMapping
Return the type code from JDBCTypes of the JDBC value returned from calls to JoinableMapping.getJoinValue(kodo.jdbc.sql.Result, kodo.jdbc.schema.Column[], kodo.jdbc.schema.ForeignKey, kodo.jdbc.sql.Joins) for the given column.
Specified by:
getJoinTypeCode in interface JoinableMapping

setAutoIncrementValue

public void setAutoIncrementValue(KodoStateManager sm,
                                  Column col,
                                  long autoInc)
Description copied from interface: JoinableMapping
Use the given auto-incremented value to set this join value's field on the given instance.
Specified by:
setAutoIncrementValue in interface JoinableMapping

SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.