Package org.apache.openjpa.jdbc.meta
Interface Joinable
- 
- All Superinterfaces:
- java.io.Serializable
 - All Known Implementing Classes:
- DelegatingJoinable,- HandlerFieldStrategy,- MaxEmbeddedBlobFieldStrategy,- MaxEmbeddedByteArrayFieldStrategy,- MaxEmbeddedCharArrayFieldStrategy,- MaxEmbeddedClobFieldStrategy,- PrimitiveFieldStrategy,- RelationFieldStrategy,- StringFieldStrategy
 
 public interface Joinable extends java.io.SerializableRepresents a value that can be joined to. Any column that a user joins to must be "owned" by an entity that implements this interface. The system maps columns to joinables to be able to decompose oids and field values into individual join values on a per-column basis. This allows us to support joins to only some of the columns of a mapping, and to be loose with the ordering of foreign key columns relative to the ordering of the joined-to columns. Having a separate interface for joinables also allows us to perform tricks such as a vertically-mapped application identity subclass transparently transforming columns of its foreign key to the corresponding primary key fields in the base class.- Author:
- Abe White
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract 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.java.lang.ObjectgetJoinValue(java.lang.Object val, Column col, JDBCStore store)Return the join value of the given column.java.lang.ObjectgetJoinValue(OpenJPAStateManager sm, Column col, JDBCStore store)Return the join value of the given column.java.lang.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, java.lang.Object autogen)Use the given auto-assigned value to set this join value's field on the given instance.
 
- 
- 
- 
Method Detail- 
getFieldIndexint getFieldIndex() Return the field index of this joinable, or -1 if not a field.
 - 
getPrimaryKeyValuejava.lang.Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws java.sql.SQLException Return 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).- Throws:
- java.sql.SQLException
 
 - 
getColumnsColumn[] getColumns() The columns managed by this joinable.
 - 
getJoinValuejava.lang.Object getJoinValue(java.lang.Object val, Column col, JDBCStore store)Return the join value of the given column.- Parameters:
- val- the value of the field for this joinable
- col- the column of this joinable whose value to return
 
 - 
getJoinValuejava.lang.Object getJoinValue(OpenJPAStateManager sm, Column col, JDBCStore store) Return the join value of the given column.- Parameters:
- sm- the instance from which to get the value
- col- the column whose value to return
 
 - 
setAutoAssignedValuevoid setAutoAssignedValue(OpenJPAStateManager sm, JDBCStore store, Column col, java.lang.Object autogen) Use the given auto-assigned value to set this join value's field on the given instance.
 
- 
 
-