|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.jdbc.meta.strats.AbstractStrategy
org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy
org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy
public class RelationFieldStrategy
Mapping for a single-valued relation to another entity.
| Field Summary |
|---|
| Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy |
|---|
field |
| Fields inherited from interface org.apache.openjpa.jdbc.meta.Embeddable |
|---|
UNSUPPORTED |
| Constructor Summary | |
|---|---|
RelationFieldStrategy()
|
|
| Method Summary | |
|---|---|
void |
appendIsNotNull(SQLBuffer sql,
Select sel,
Joins joins)
Append a where clause to the given statement checking if this value is not null. |
void |
appendIsNull(SQLBuffer sql,
Select sel,
Joins joins)
Append a where clause to the given statement checking if this value is null. |
void |
delete(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates. |
ColumnIO |
getColumnIO()
Return column I/O information for this mapping. |
Column[] |
getColumns()
Return the columns used by this strategy. |
int |
getFieldIndex()
Return the field index of this joinable, or -1 if not a field. |
Object |
getJoinValue(Object fieldVal,
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. |
Object[] |
getResultArguments()
Return the arguments needed to extract datastore values via Result.getObject(java.lang.Object, int, java.lang.Object) for each column. |
void |
initialize()
Perform caching and other initialization operations. |
void |
insert(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set values for the mapping into the proper rows. |
Joins |
join(Joins joins,
boolean forceOuter)
Join this value to the class table. |
Joins |
joinRelation(Joins joins,
boolean forceOuter,
boolean traverse)
Join this value's table to the table for the related first class object type, if any. |
void |
load(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
Load secondary data using a connection from the store manager. |
void |
load(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Result res)
Load virtual row data; the given result is not guaranteed to contain data for this field, so the field mapping should make sure the result contains its needed column data before loading. |
void |
loadEagerJoin(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Result res)
Load the joined eager result. |
Object |
loadEagerParallel(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Object res)
Load the batched eager result. |
void |
loadEmbedded(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Object val)
Load this strategy's field by transforming the given datastore value. |
void |
map(boolean adapt)
Map the owning mapping using this strategy. |
protected Union |
newUnion(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
ClassMapping[] rels,
int subs,
Joins[] resJoins)
|
int |
select(Select sel,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
Select the virtual row columns of this mapping. |
void |
selectEagerJoin(Select sel,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
Fill in joined select to related objects. |
void |
selectEagerParallel(SelectExecutor sel,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
Fill in parallel eager select for related objects. |
void |
setAutoAssignedValue(OpenJPAStateManager sm,
JDBCStore store,
Column col,
Object autoInc)
Use the given auto-assigned value to set this join value's field on the given instance. |
int |
supportsSelect(Select sel,
int type,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
Return whether this mapping can perform the given select type. |
Object |
toDataStoreValue(Object val,
JDBCStore store)
Translate the given external field value to its datastore equivalent. |
Object |
toEmbeddedDataStoreValue(Object val,
JDBCStore store)
Convert the given Java value to its datastore equivalent. |
Object |
toEmbeddedObjectValue(Object val)
Convert the given datastore value to its Java equivalent. |
void |
update(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set values for the mapping into the proper rows. |
| Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy |
|---|
appendIsEmpty, appendIsNotEmpty, appendSize, assertNotMappedBy, isEagerSelectToMany, isVersionable, joinKey, joinKeyRelation, loadKeyProjection, loadProjection, setFieldMapping, toKeyDataStoreValue, where |
| Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy |
|---|
customDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.openjpa.jdbc.meta.Strategy |
|---|
customDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdate |
| Constructor Detail |
|---|
public RelationFieldStrategy()
| Method Detail |
|---|
public void map(boolean adapt)
Strategy
map in interface Strategymap in class AbstractStrategyadapt - if true, use the owning mapping's raw mapping info
to set its ORM data; if false, ORM data will already be setpublic void initialize()
StrategyStrategy.map(boolean), and after all related components have been
mapped as well.
initialize in interface Strategyinitialize in class AbstractStrategy
public void insert(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
throws SQLException
Strategy
insert in interface Strategyinsert in class AbstractStrategySQLException
public void update(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
throws SQLException
Strategy
update in interface Strategyupdate in class AbstractStrategySQLExceptionStrategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)
public void delete(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
throws SQLException
Strategy
delete in interface Strategydelete in class AbstractStrategySQLExceptionStrategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)
public int supportsSelect(Select sel,
int type,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
FieldStrategy
supportsSelect in interface FieldStrategysupportsSelect in class AbstractFieldStrategySelect
public void selectEagerParallel(SelectExecutor sel,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
FieldStrategy
selectEagerParallel in interface FieldStrategyselectEagerParallel in class AbstractFieldStrategyFieldStrategy.select(org.apache.openjpa.jdbc.sql.Select, org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, int)
public void selectEagerJoin(Select sel,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
FieldStrategy
selectEagerJoin in interface FieldStrategyselectEagerJoin in class AbstractFieldStrategyFieldStrategy.select(org.apache.openjpa.jdbc.sql.Select, org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, int)
public int select(Select sel,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
FieldStrategy
select in interface FieldStrategyselect in class AbstractFieldStrategysel - the select to add tosm - the instance being loaded, or null if not
initialized yet or selecting for multiple instancesstore - the current store managerfetch - fetch configurationeagerMode - the eager fetch mode to use; this may be more
restrictive than the mode of the fetch configuration
public Object loadEagerParallel(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Object res)
throws SQLException
FieldStrategy
loadEagerParallel in interface FieldStrategyloadEagerParallel in class AbstractFieldStrategyres - originally the Result to load from, but this
method may return a processed result form that will be
passed to subsequent calls
SQLException
public void loadEagerJoin(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Result res)
throws SQLException
FieldStrategy
loadEagerJoin in interface FieldStrategyloadEagerJoin in class AbstractFieldStrategySQLException
public void load(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Result res)
throws SQLException
FieldStrategy
load in interface FieldStrategyload in class AbstractFieldStrategySQLException
public void load(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
throws SQLException
FieldStrategy
load in interface FieldStrategyload in class AbstractFieldStrategySQLException
protected Union newUnion(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
ClassMapping[] rels,
int subs,
Joins[] resJoins)
public Object toDataStoreValue(Object val,
JDBCStore store)
FieldStrategy
toDataStoreValue in interface FieldStrategytoDataStoreValue in class AbstractFieldStrategy
public void appendIsNull(SQLBuffer sql,
Select sel,
Joins joins)
FieldStrategy
appendIsNull in interface FieldStrategyappendIsNull in class AbstractFieldStrategy
public void appendIsNotNull(SQLBuffer sql,
Select sel,
Joins joins)
FieldStrategy
appendIsNotNull in interface FieldStrategyappendIsNotNull in class AbstractFieldStrategy
public Joins join(Joins joins,
boolean forceOuter)
FieldStrategy
join in interface FieldStrategyjoin in class AbstractFieldStrategy
public Joins joinRelation(Joins joins,
boolean forceOuter,
boolean traverse)
FieldStrategy
joinRelation in interface FieldStrategyjoinRelation in class AbstractFieldStrategytraverse - if true, throw proper exception if it is not
possible for this mapping to traverse into the related typepublic int getFieldIndex()
Joinable
getFieldIndex in interface Joinable
public Object getPrimaryKeyValue(Result res,
Column[] cols,
ForeignKey fk,
JDBCStore store,
Joins joins)
throws SQLException
JoinableForeignKey.getColumn(org.apache.openjpa.jdbc.schema.Column).
getPrimaryKeyValue in interface JoinableSQLException
public Object getJoinValue(Object fieldVal,
Column col,
JDBCStore store)
Joinable
getJoinValue in interface JoinablefieldVal - the value of the field for this joinablecol - the column of this joinable whose value to return
public Object getJoinValue(OpenJPAStateManager sm,
Column col,
JDBCStore store)
Joinable
getJoinValue in interface Joinablesm - the instance from which to get the valuecol - the column whose value to return
public void setAutoAssignedValue(OpenJPAStateManager sm,
JDBCStore store,
Column col,
Object autoInc)
Joinable
setAutoAssignedValue in interface Joinablepublic Column[] getColumns()
Embeddable
getColumns in interface EmbeddablegetColumns in interface Joinablepublic ColumnIO getColumnIO()
Embeddable
getColumnIO in interface Embeddablepublic Object[] getResultArguments()
EmbeddableResult.getObject(java.lang.Object, int, java.lang.Object) for each column.
getResultArguments in interface Embeddable
public Object toEmbeddedDataStoreValue(Object val,
JDBCStore store)
Embeddable
toEmbeddedDataStoreValue in interface Embeddablepublic Object toEmbeddedObjectValue(Object val)
EmbeddableEmbeddable.getColumns() returns multiple columns, the given datastore
value will be an object array of the corresponding length. This method
must only be supported by mappings of embedded id objects. In other
cases Embeddable.loadEmbedded(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, java.lang.Object) will be used instead. Return
Embeddable.UNSUPPORTED if this mapping cannot support this method.
toEmbeddedObjectValue in interface Embeddable
public void loadEmbedded(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Object val)
throws SQLException
EmbeddableEmbeddable.getColumns() returns multiple columns, the given datastore
value will be an object array of the corresponding length. The value
does not have to be loaded immediately; it may be stored as impl data.
loadEmbedded in interface EmbeddableSQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||