Class HandlerStrategies
java.lang.Object
org.apache.openjpa.jdbc.meta.strats.HandlerStrategies
Utility methods for strategies using value handlers.
- Since:
- 0.4.0
- Author:
- Abe White
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Throw the proper exception if the given handler-controlled value represents an unjoinable relation.static Object
loadDataStore
(ValueMapping vm, Result res, Joins joins, Column[] cols) Load the datastore value from the given result.static Object
loadObject
(ValueMapping vm, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins, Column[] cols, boolean objectValueRequiresLoad) Load the Object value from the given result.static Column[]
map
(ValueMapping vm, String name, ColumnIO io, boolean adapt) Map the given value.static boolean
set
(ValueMapping vm, Object val, JDBCStore store, Row row, Column[] cols, ColumnIO io, boolean nullNone) Set the given value into the given row.static Object
toDataStoreValue
(ValueMapping vm, Object val, Column[] cols, JDBCStore store) Convert the given object to its datastore value(s).static void
Add where conditions to the given row.
-
Constructor Details
-
HandlerStrategies
public HandlerStrategies()
-
-
Method Details
-
map
Map the given value. -
set
public static boolean set(ValueMapping vm, Object val, JDBCStore store, Row row, Column[] cols, ColumnIO io, boolean nullNone) throws SQLException Set the given value into the given row. Return false if the given value can not be set, for example, due to null constraints on the columns.- Throws:
SQLException
-
where
public static void where(ValueMapping vm, Object val, JDBCStore store, Row row, Column[] cols) throws SQLException Add where conditions to the given row.- Throws:
SQLException
-
loadObject
public static Object loadObject(ValueMapping vm, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins, Column[] cols, boolean objectValueRequiresLoad) throws SQLException Load the Object value from the given result.- Throws:
SQLException
-
loadDataStore
public static Object loadDataStore(ValueMapping vm, Result res, Joins joins, Column[] cols) throws SQLException Load the datastore value from the given result. This method does not process the loaded value throughValueHandler.toObjectValue(org.apache.openjpa.jdbc.meta.ValueMapping, java.lang.Object)
.- Throws:
SQLException
-
toDataStoreValue
Convert the given object to its datastore value(s). Relation ids are converted to their final values immediately. -
assertJoinable
Throw the proper exception if the given handler-controlled value represents an unjoinable relation.
-