Class MaxEmbeddedBlobFieldStrategy
java.lang.Object
org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy
org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy
org.apache.openjpa.jdbc.meta.strats.MaxEmbeddedBlobFieldStrategy
- All Implemented Interfaces:
- Serializable,- Embeddable,- FieldStrategy,- Joinable,- Strategy
Mapping for serialized fields on a dictionary that has a maximum embedded
 BLOB size.
- Since:
- 0.4.0
- Author:
- Abe White
- See Also:
- 
Field SummaryFields inherited from class org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy_args, _cols, _io, _load, _lobFields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategyfieldFields inherited from interface org.apache.openjpa.jdbc.meta.EmbeddableUNSUPPORTED
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcustomInsert(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.protected intReturn the expected type of the field fromJavaTypesorJavaSQLTypes.protected ObjectvoidPerform caching and other initialization operations.voidinsert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) Set values for the mapping into the proper rows.protected BooleanisCustom(OpenJPAStateManager sm, JDBCStore store) Return whether this is a custom insert/update.isCustomInsert(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.isCustomUpdate(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.booleanReturn true if this field can be used as part of a state image for optimistic locking.Join this value to the class table.protected ObjectLoad this value from the given result.voidload(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch) Load secondary data using a connection from the store manager.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.loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) Load this field value using the given result.voidmap(boolean adapt) Map the owning mapping using this strategy.protected voidputData(OpenJPAStateManager sm, ResultSet rs, DBDictionary dict) Set the data from the given state manager into the result set.intselect(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) Select the virtual row columns of this mapping.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.protected voidupdate(OpenJPAStateManager sm, Row row) Set the value of the owning field into the given row.voidwhere(OpenJPAStateManager sm, JDBCStore store, RowManager rm, Object prevValue) Add a WHERE condition to the row for this field such that the field's current DB value must equal the given previous value.Methods inherited from class org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategyappendIsNotNull, appendIsNull, getColumnIO, getColumns, getFieldIndex, getJoinValue, getJoinValue, getPrimaryKeyValue, getResultArguments, joinRelation, loadEmbedded, setAutoAssignedValue, toDataStoreValue, toEmbeddedDataStoreValue, toEmbeddedObjectValueMethods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategyappendIndex, appendIsEmpty, appendIsNotEmpty, appendSize, appendType, assertNotMappedBy, isEagerSelectToMany, joinKey, joinKeyRelation, loadEagerJoin, loadEagerParallel, loadKeyProjection, selectEagerJoin, selectEagerParallel, setFieldMapping, toKeyDataStoreValueMethods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategycustomDelete, getAlias, isCustomDeleteMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openjpa.jdbc.meta.StrategycustomDelete, getAlias, isCustomDelete
- 
Constructor Details- 
MaxEmbeddedBlobFieldStrategypublic MaxEmbeddedBlobFieldStrategy()
 
- 
- 
Method Details- 
getExpectedJavaTypeprotected int getExpectedJavaType()Return the expected type of the field fromJavaTypesorJavaSQLTypes.
- 
updateSet the value of the owning field into the given row.- Throws:
- SQLException
 
- 
isCustomReturn whether this is a custom insert/update.
- 
putDataSet the data from the given state manager into the result set.- Throws:
- SQLException
 
- 
mappublic void map(boolean adapt) Description copied from interface:StrategyMap the owning mapping using this strategy.
- 
initializepublic void initialize()Description copied from interface:StrategyPerform caching and other initialization operations. This method is called afterStrategy.map(boolean), and after all related components have been mapped as well.- Specified by:
- initializein interface- Strategy
- Overrides:
- initializein class- HandlerFieldStrategy
 
- 
getValue
- 
isCustomInsertDescription 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 interface- Strategy
- Overrides:
- isCustomInsertin class- AbstractStrategy
 
- 
isCustomUpdateDescription 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 interface- Strategy
- Overrides:
- isCustomUpdatein class- AbstractStrategy
 
- 
insertDescription 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 interface- Strategy
- Overrides:
- insertin class- HandlerFieldStrategy
- Throws:
- SQLException
 
- 
updateDescription copied from interface:StrategySet values for the mapping into the proper rows.- Specified by:
- updatein interface- Strategy
- Overrides:
- updatein class- HandlerFieldStrategy
- Throws:
- SQLException
- See Also:
 
- 
deleteDescription 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 interface- Strategy
- Overrides:
- deletein class- HandlerFieldStrategy
- Throws:
- SQLException
- See Also:
 
- 
customInsertDescription 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 interface- Strategy
- Overrides:
- customInsertin class- AbstractStrategy
- Throws:
- SQLException
 
- 
customUpdateDescription copied from interface:StrategyOverride this method to customize flushing this mapping. For classes, this method must also flush all fields.- Specified by:
- customUpdatein interface- Strategy
- Overrides:
- customUpdatein class- AbstractStrategy
- Throws:
- SQLException
 
- 
supportsSelectpublic 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 interface- FieldStrategy
- Overrides:
- supportsSelectin class- HandlerFieldStrategy
- See Also:
 
- 
selectpublic 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 interface- FieldStrategy
- Overrides:
- selectin class- HandlerFieldStrategy
- Parameters:
- sel- the select to add to
- sm- the instance being loaded, or null if not initialized yet or selecting for multiple instances
- store- the current store manager
- fetch- fetch configuration
- eagerMode- 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
 
- 
loadpublic void load(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws 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 interface- FieldStrategy
- Overrides:
- loadin class- HandlerFieldStrategy
- Throws:
- SQLException
 
- 
loadpublic void load(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch) throws SQLException Description copied from interface:FieldStrategyLoad secondary data using a connection from the store manager.- Specified by:
- loadin interface- FieldStrategy
- Overrides:
- loadin class- HandlerFieldStrategy
- Throws:
- SQLException
 
- 
loadLoad this value from the given result.- Throws:
- SQLException
 
- 
joinDescription copied from interface:FieldStrategyJoin this value to the class table. Does nothing by default.- Specified by:
- joinin interface- FieldStrategy
- Overrides:
- joinin class- HandlerFieldStrategy
 
- 
loadProjectionpublic Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException Description copied from interface:FieldStrategyLoad this field value using the given result. The result will contain the columns fromValueMapping.getColumns().- Specified by:
- loadProjectionin interface- FieldStrategy
- Overrides:
- loadProjectionin class- HandlerFieldStrategy
- Throws:
- SQLException
 
- 
isVersionablepublic boolean isVersionable()Description copied from interface:FieldStrategyReturn true if this field can be used as part of a state image for optimistic locking.- Specified by:
- isVersionablein interface- FieldStrategy
- Overrides:
- isVersionablein class- HandlerFieldStrategy
 
- 
wherepublic void where(OpenJPAStateManager sm, JDBCStore store, RowManager rm, Object prevValue) throws SQLException Description copied from interface:FieldStrategyAdd a WHERE condition to the row for this field such that the field's current DB value must equal the given previous value. Only versionable mappings must implement this method meaningfully.- Specified by:
- wherein interface- FieldStrategy
- Overrides:
- wherein class- HandlerFieldStrategy
- Throws:
- SQLException
 
 
-