public class EmbedFieldStrategy extends AbstractFieldStrategy implements Embeddable
fieldUNSUPPORTED| Constructor and Description |
|---|
EmbedFieldStrategy() |
| Modifier and Type | Method and Description |
|---|---|
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 |
customDelete(OpenJPAStateManager sm,
JDBCStore store)
Override this method to customize flushing this mapping.
|
void |
customInsert(OpenJPAStateManager sm,
JDBCStore store)
Override this method to customize flushing this mapping.
|
void |
customUpdate(OpenJPAStateManager sm,
JDBCStore store)
Override this method to customize flushing this mapping.
|
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.
|
void |
delete(OpenJPAStateManager owner,
OpenJPAStateManager sm,
JDBCStore store,
RowManager rm,
Row row)
Delete an embedded object record.
|
ColumnIO |
getColumnIO()
Return column I/O information for this mapping.
|
Column[] |
getColumns()
Return the columns used by this strategy.
|
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.
|
void |
insert(OpenJPAStateManager owner,
OpenJPAStateManager sm,
JDBCStore store,
RowManager rm,
Row row)
Insert an embedded object.
|
Boolean |
isCustomDelete(OpenJPAStateManager sm,
JDBCStore store)
Return
Boolean.FALSE if this mapping does not customize the
delete process, Boolean.TRUE if it does, or null if it does
customize the delete, but also relies on the standard delete method
being called. |
Boolean |
isCustomInsert(OpenJPAStateManager sm,
JDBCStore store)
Return
Boolean.FALSE if this mapping does not customize the
insert process, Boolean.TRUE if it does, or null if it does
customize the insert, but also relies on the standard insert method
being called. |
Boolean |
isCustomUpdate(OpenJPAStateManager sm,
JDBCStore store)
Return
Boolean.FALSE if this mapping does not customize the
update process, Boolean.TRUE if it does, or null if it does
customize the update, but also relies on the standard update method
being called. |
Joins |
join(Joins joins,
boolean forceOuter)
Join this value to the class table.
|
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 |
loadEmbedded(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Object val)
Load this strategy's field by transforming the given datastore value.
|
Object |
loadProjection(JDBCStore store,
JDBCFetchConfiguration fetch,
Result res,
Joins joins)
Loading embed object without instantiating owner entity
|
void |
map(boolean adapt)
Map the owning mapping using this strategy.
|
int |
select(Select sel,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
Select the virtual row columns of this mapping.
|
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.
|
void |
update(OpenJPAStateManager owner,
OpenJPAStateManager sm,
JDBCStore store,
RowManager rm,
Row row)
Update an embedded object.
|
appendIndex, appendIsEmpty, appendIsNotEmpty, appendSize, appendType, assertNotMappedBy, isEagerSelectToMany, isVersionable, joinKey, joinKeyRelation, joinRelation, load, loadEagerJoin, loadEagerParallel, loadKeyProjection, selectEagerJoin, selectEagerParallel, setFieldMapping, toKeyDataStoreValue, wheregetAliaspublic void map(boolean adapt)
Strategymap 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 AbstractStrategypublic void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategyinsert in interface Strategyinsert in class AbstractStrategySQLExceptionpublic void insert(OpenJPAStateManager owner, OpenJPAStateManager sm, JDBCStore store, RowManager rm, Row row) throws SQLException
owner - the owning state managersm - the embedded state manager, or null if the value is nullrm - the row managerrow - expected row for this embedded valueSQLExceptionpublic void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategyupdate 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 update(OpenJPAStateManager owner, OpenJPAStateManager sm, JDBCStore store, RowManager rm, Row row) throws SQLException
owner - the owning state managersm - the embedded state manager, or null if the value is nullrm - the row managerrow - expected row for this embedded valueSQLExceptionpublic void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategydelete 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 void delete(OpenJPAStateManager owner, OpenJPAStateManager sm, JDBCStore store, RowManager rm, Row row) throws SQLException
owner - the owning state managersm - the embedded state manager, or null if not knownrm - the row managerrow - expected row for this embedded valueSQLExceptionpublic Boolean isCustomInsert(OpenJPAStateManager sm, JDBCStore store)
StrategyBoolean.FALSE if this mapping does not customize the
insert process, Boolean.TRUE if it does, or null if it does
customize the insert, but also relies on the standard insert method
being called. Implement the Strategy.customInsert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore) method
to implement the custom insertion behavior.isCustomInsert in interface StrategyisCustomInsert in class AbstractStrategypublic Boolean isCustomUpdate(OpenJPAStateManager sm, JDBCStore store)
StrategyBoolean.FALSE if this mapping does not customize the
update process, Boolean.TRUE if it does, or null if it does
customize the update, but also relies on the standard update method
being called. Implement the Strategy.customUpdate(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore) method
to override the default update behavior.isCustomUpdate in interface StrategyisCustomUpdate in class AbstractStrategypublic Boolean isCustomDelete(OpenJPAStateManager sm, JDBCStore store)
StrategyBoolean.FALSE if this mapping does not customize the
delete process, Boolean.TRUE if it does, or null if it does
customize the delete, but also relies on the standard delete method
being called. Implement the Strategy.customDelete(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore) method
to override the default deletion behavior.isCustomDelete in interface StrategyisCustomDelete in class AbstractStrategypublic void customInsert(OpenJPAStateManager sm, JDBCStore store) throws SQLException
StrategycustomInsert in interface StrategycustomInsert in class AbstractStrategySQLExceptionpublic void customUpdate(OpenJPAStateManager sm, JDBCStore store) throws SQLException
StrategycustomUpdate in interface StrategycustomUpdate in class AbstractStrategySQLExceptionpublic void customDelete(OpenJPAStateManager sm, JDBCStore store) throws SQLException
StrategycustomDelete in interface StrategycustomDelete in class AbstractStrategySQLExceptionpublic int supportsSelect(Select sel, int type, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch)
FieldStrategysupportsSelect in interface FieldStrategysupportsSelect in class AbstractFieldStrategySelectpublic int select(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode)
FieldStrategyselect 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 configurationpublic void load(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException
FieldStrategyload in interface FieldStrategyload in class AbstractFieldStrategySQLExceptionpublic Object toDataStoreValue(Object val, JDBCStore store)
FieldStrategytoDataStoreValue in interface FieldStrategytoDataStoreValue in class AbstractFieldStrategypublic void appendIsNull(SQLBuffer sql, Select sel, Joins joins)
FieldStrategyappendIsNull in interface FieldStrategyappendIsNull in class AbstractFieldStrategypublic void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins)
FieldStrategyappendIsNotNull in interface FieldStrategyappendIsNotNull in class AbstractFieldStrategypublic Joins join(Joins joins, boolean forceOuter)
FieldStrategyjoin in interface FieldStrategyjoin in class AbstractFieldStrategypublic Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
loadProjection in interface FieldStrategyloadProjection in class AbstractFieldStrategySQLExceptionpublic Column[] getColumns()
EmbeddablegetColumns in interface Embeddablepublic ColumnIO getColumnIO()
EmbeddablegetColumnIO in interface Embeddablepublic Object[] getResultArguments()
EmbeddableResult.getObject(java.lang.Object, int, java.lang.Object) for each column.getResultArguments in interface Embeddablepublic Object toEmbeddedDataStoreValue(Object val, JDBCStore store)
EmbeddabletoEmbeddedDataStoreValue 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 Embeddablepublic 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 EmbeddableSQLExceptionCopyright © 2006–2022 Apache Software Foundation. All rights reserved.