Package org.apache.openjpa.jdbc.meta
Class DelegatingJoinable
- java.lang.Object
 - 
- org.apache.openjpa.jdbc.meta.DelegatingJoinable
 
 
- 
- All Implemented Interfaces:
 Serializable,Joinable
public class DelegatingJoinable extends Object implements Joinable
Delegates to anotherJoinableafter 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 joinables of the superclass to actually extract the column values from field values and so forth, but in order for other mappings to join to its foreign key columns it needs joinables of its own. So it creates delegating joinables.- Author:
 - Abe White
 - See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description DelegatingJoinable(Joinable join, Column[] cols)Constructor.DelegatingJoinable(Joinable join, ForeignKey fk)Constructor. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Column[]getColumns()The columns managed by this joinable.intgetFieldIndex()Return the field index of this joinable, or -1 if not a field.ObjectgetJoinValue(Object val, Column col, JDBCStore store)Return the join value of the given column.ObjectgetJoinValue(OpenJPAStateManager sm, Column col, JDBCStore store)Return the join value of the given column.ObjectgetPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins)Return the value for this joinable from the given result, using the given columns.voidsetAutoAssignedValue(OpenJPAStateManager sm, JDBCStore store, Column col, Object autogen)Use the given auto-assigned value to set this join value's field on the given instance. 
 - 
 
- 
- 
Constructor Detail
- 
DelegatingJoinable
public DelegatingJoinable(Joinable join, ForeignKey fk)
Constructor.- Parameters:
 join- the mapping to delegate tofk- the foreign key to use to translate any given columns to the given delegate's columns
 
 - 
 
- 
Method Detail
- 
getFieldIndex
public int getFieldIndex()
Description copied from interface:JoinableReturn the field index of this joinable, or -1 if not a field.- Specified by:
 getFieldIndexin interfaceJoinable
 
- 
getPrimaryKeyValue
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException
Description copied from interface:JoinableReturn the value for this joinable from the given result, using the given columns. If the given foreign key is non-null, use the foreign key's columns by translating the given columns throughForeignKey.getColumn(org.apache.openjpa.jdbc.schema.Column).- Specified by:
 getPrimaryKeyValuein interfaceJoinable- Throws:
 SQLException
 
- 
getColumns
public Column[] getColumns()
Description copied from interface:JoinableThe columns managed by this joinable.- Specified by:
 getColumnsin interfaceJoinable
 
- 
getJoinValue
public Object getJoinValue(Object val, Column col, JDBCStore store)
Description copied from interface:JoinableReturn the join value of the given column.- Specified by:
 getJoinValuein interfaceJoinable- Parameters:
 val- the value of the field for this joinablecol- the column of this joinable whose value to return
 
- 
getJoinValue
public Object getJoinValue(OpenJPAStateManager sm, Column col, JDBCStore store)
Description copied from interface:JoinableReturn the join value of the given column.- Specified by:
 getJoinValuein interfaceJoinable- Parameters:
 sm- the instance from which to get the valuecol- the column whose value to return
 
- 
setAutoAssignedValue
public void setAutoAssignedValue(OpenJPAStateManager sm, JDBCStore store, Column col, Object autogen)
Description copied from interface:JoinableUse the given auto-assigned value to set this join value's field on the given instance.- Specified by:
 setAutoAssignedValuein interfaceJoinable
 
 - 
 
 -