Class LobFieldStrategy
- java.lang.Object
-
- org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
-
- org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy
-
- org.apache.openjpa.jdbc.meta.strats.LobFieldStrategy
-
- All Implemented Interfaces:
java.io.Serializable,FieldStrategy,Strategy
public class LobFieldStrategy extends AbstractFieldStrategy
Direct mapping from a stream value to a column.- Since:
- 1.1.0
- Author:
- Ignacio Andreu
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy
field
-
-
Constructor Summary
Constructors Constructor Description LobFieldStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertNotMappedBy()Throws an informative exception if the field declares a mapped-by value.voidcustomInsert(OpenJPAStateManager sm, JDBCStore store)Override this method to customize flushing this mapping.voidcustomUpdate(OpenJPAStateManager sm, JDBCStore store)Override this method to customize flushing this mapping.voiddelete(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.voidinsert(OpenJPAStateManager sm, JDBCStore store, RowManager rm)Set values for the mapping into the proper rows.java.lang.BooleanisCustomInsert(OpenJPAStateManager sm, JDBCStore store)ReturnBoolean.FALSEif this mapping does not customize the insert process,Boolean.TRUEif it does, or null if it does customize the insert, but also relies on the standard insert method being called.java.lang.BooleanisCustomUpdate(OpenJPAStateManager sm, JDBCStore store)ReturnBoolean.FALSEif this mapping does not customize the update process,Boolean.TRUEif it does, or null if it does customize the update, but also relies on the standard update method being called.voidload(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.voidmap(boolean adapt)Map the owning mapping using this strategy.intselect(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode)Select the virtual row columns of this mapping.voidsetFieldMapping(FieldMapping owner)Set the class mapping using this strategy.intsupportsSelect(Select sel, int type, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch)Return whether this mapping can perform the given select type.voidupdate(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
appendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendSize, appendType, isEagerSelectToMany, isVersionable, join, joinKey, joinKeyRelation, joinRelation, load, loadEagerJoin, loadEagerParallel, loadKeyProjection, loadProjection, selectEagerJoin, selectEagerParallel, toDataStoreValue, toKeyDataStoreValue, where
-
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
customDelete, getAlias, initialize, isCustomDelete
-
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, getAlias, initialize, isCustomDelete
-
-
-
-
Method Detail
-
map
public void map(boolean adapt)
Description copied from interface:StrategyMap the owning mapping using this strategy.- Specified by:
mapin interfaceStrategy- Overrides:
mapin classAbstractStrategy- Parameters:
adapt- if true, use the owning mapping's raw mapping info to set its ORM data; if false, ORM data will already be set
-
isCustomInsert
public java.lang.Boolean isCustomInsert(OpenJPAStateManager sm, JDBCStore store)
Description copied from interface:StrategyReturnBoolean.FALSEif this mapping does not customize the insert process,Boolean.TRUEif it does, or null if it does customize the insert, but also relies on the standard insert method being called. Implement theStrategy.customInsert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore)method to implement the custom insertion behavior.- Specified by:
isCustomInsertin interfaceStrategy- Overrides:
isCustomInsertin classAbstractStrategy
-
delete
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws java.sql.SQLException
Description copied from interface:StrategySet the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates. This allows foreign key analysis.- Specified by:
deletein interfaceStrategy- Overrides:
deletein classAbstractStrategy- Throws:
java.sql.SQLException- See Also:
Strategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)
-
insert
public void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws java.sql.SQLException
Description copied from interface:StrategySet values for the mapping into the proper rows. For class mappings, this method will be called only after the corresponding method has been called for all fields of this mapping.- Specified by:
insertin interfaceStrategy- Overrides:
insertin classAbstractStrategy- Throws:
java.sql.SQLException
-
customInsert
public void customInsert(OpenJPAStateManager sm, JDBCStore store) throws java.sql.SQLException
Description copied from interface:StrategyOverride this method to customize flushing this mapping. For classes, this method must also flush all fields. For fields, this method is called after the owning object is inserted, so if this field is in a row with other fields, that row will already exist.- Specified by:
customInsertin interfaceStrategy- Overrides:
customInsertin classAbstractStrategy- Throws:
java.sql.SQLException
-
isCustomUpdate
public java.lang.Boolean isCustomUpdate(OpenJPAStateManager sm, JDBCStore store)
Description copied from interface:StrategyReturnBoolean.FALSEif this mapping does not customize the update process,Boolean.TRUEif it does, or null if it does customize the update, but also relies on the standard update method being called. Implement theStrategy.customUpdate(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore)method to override the default update behavior.- Specified by:
isCustomUpdatein interfaceStrategy- Overrides:
isCustomUpdatein classAbstractStrategy
-
update
public void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws java.sql.SQLException
Description copied from interface:StrategySet values for the mapping into the proper rows.- Specified by:
updatein interfaceStrategy- Overrides:
updatein classAbstractStrategy- Throws:
java.sql.SQLException- See Also:
Strategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)
-
customUpdate
public void customUpdate(OpenJPAStateManager sm, JDBCStore store) throws java.sql.SQLException
Description copied from interface:StrategyOverride this method to customize flushing this mapping. For classes, this method must also flush all fields.- Specified by:
customUpdatein interfaceStrategy- Overrides:
customUpdatein classAbstractStrategy- Throws:
java.sql.SQLException
-
supportsSelect
public int supportsSelect(Select sel, int type, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch)
Description copied from interface:FieldStrategyReturn whether this mapping can perform the given select type. Return 0 if the given type is not supported. If the given type is an eager parallel type, return the number of UNIONed selects necessary to fetch the data. Otherwise, return any positive number if the type is supported. The given state manager may be null if selecting multiple instances.- Specified by:
supportsSelectin interfaceFieldStrategy- Overrides:
supportsSelectin classAbstractFieldStrategy- See Also:
Select
-
select
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode)
Description copied from interface:FieldStrategySelect the virtual row columns of this mapping.- Specified by:
selectin interfaceFieldStrategy- Overrides:
selectin classAbstractFieldStrategy- Parameters:
sel- 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- Returns:
- > 0 if this mapping requires the selected data (if any), 0 if it selected data but does not require it, or < 0 if no data was selected
-
load
public void load(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws java.sql.SQLException
Description copied from interface:FieldStrategyLoad 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.- Specified by:
loadin interfaceFieldStrategy- Overrides:
loadin classAbstractFieldStrategy- Throws:
java.sql.SQLException
-
assertNotMappedBy
protected void assertNotMappedBy()
Description copied from class:AbstractFieldStrategyThrows an informative exception if the field declares a mapped-by value.- Overrides:
assertNotMappedByin classAbstractFieldStrategy
-
setFieldMapping
public void setFieldMapping(FieldMapping owner)
Description copied from interface:FieldStrategySet the class mapping using this strategy. This will be called before use.- Specified by:
setFieldMappingin interfaceFieldStrategy- Overrides:
setFieldMappingin classAbstractFieldStrategy
-
-