|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.jdbc.meta.DelegatingJoinable
public class DelegatingJoinable
Delegates to another Joinable
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 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.
Constructor Summary | |
---|---|
DelegatingJoinable(Joinable join,
Column[] cols)
Constructor. |
|
DelegatingJoinable(Joinable join,
ForeignKey fk)
Constructor. |
Method Summary | |
---|---|
Column[] |
getColumns()
The columns managed by this joinable. |
int |
getFieldIndex()
Return the field index of this joinable, or -1 if not a field. |
Object |
getJoinValue(Object val,
Column col,
JDBCStore store)
Return the join value of the given column. |
Object |
getJoinValue(OpenJPAStateManager sm,
Column col,
JDBCStore store)
Return the join value of the given column. |
Object |
getPrimaryKeyValue(Result res,
Column[] cols,
ForeignKey fk,
JDBCStore store,
Joins joins)
Return the value for this joinable from the given result, using the given columns. |
void |
setAutoAssignedValue(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DelegatingJoinable(Joinable join, ForeignKey fk)
join
- the mapping to delegate tofk
- the foreign key to use to translate any given columns
to the given delegate's columnspublic DelegatingJoinable(Joinable join, Column[] cols)
join
- the mapping to delegate tocols
- translated columnsMethod Detail |
---|
public int getFieldIndex()
Joinable
getFieldIndex
in interface Joinable
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException
Joinable
ForeignKey.getColumn(org.apache.openjpa.jdbc.schema.Column)
.
getPrimaryKeyValue
in interface Joinable
SQLException
public Column[] getColumns()
Joinable
getColumns
in interface Joinable
public Object getJoinValue(Object val, Column col, JDBCStore store)
Joinable
getJoinValue
in interface Joinable
val
- the value of the field for this joinablecol
- the column of this joinable whose value to returnpublic Object getJoinValue(OpenJPAStateManager sm, Column col, JDBCStore store)
Joinable
getJoinValue
in interface Joinable
sm
- the instance from which to get the valuecol
- the column whose value to returnpublic void setAutoAssignedValue(OpenJPAStateManager sm, JDBCStore store, Column col, Object autogen)
Joinable
setAutoAssignedValue
in interface Joinable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |