org.apache.openjpa.jdbc.meta.strats
Class HandlerStrategies

java.lang.Object
  extended by org.apache.openjpa.jdbc.meta.strats.HandlerStrategies

public class HandlerStrategies
extends java.lang.Object

Utility methods for strategies using value handlers.

Since:
0.4.0
Author:
Abe White

Constructor Summary
HandlerStrategies()
           
 
Method Summary
static void assertJoinable(ValueMapping vm)
          Throw the proper exception if the given handler-controlled value represents an unjoinable relation.
static java.lang.Object loadDataStore(ValueMapping vm, Result res, Joins joins, Column[] cols)
          Load the datastore value from the given result.
static java.lang.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, java.lang.String name, ColumnIO io, boolean adapt)
          Map the given value.
static boolean set(ValueMapping vm, java.lang.Object val, JDBCStore store, Row row, Column[] cols, ColumnIO io, boolean nullNone)
          Set the given value into the given row.
static java.lang.Object toDataStoreValue(ValueMapping vm, java.lang.Object val, Column[] cols, JDBCStore store)
          Convert the given object to its datastore value(s).
static void where(ValueMapping vm, java.lang.Object val, JDBCStore store, Row row, Column[] cols)
          Add where conditions to the given row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerStrategies

public HandlerStrategies()
Method Detail

map

public static Column[] map(ValueMapping vm,
                           java.lang.String name,
                           ColumnIO io,
                           boolean adapt)
Map the given value.


set

public static boolean set(ValueMapping vm,
                          java.lang.Object val,
                          JDBCStore store,
                          Row row,
                          Column[] cols,
                          ColumnIO io,
                          boolean nullNone)
                   throws java.sql.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:
java.sql.SQLException

where

public static void where(ValueMapping vm,
                         java.lang.Object val,
                         JDBCStore store,
                         Row row,
                         Column[] cols)
                  throws java.sql.SQLException
Add where conditions to the given row.

Throws:
java.sql.SQLException

loadObject

public static java.lang.Object loadObject(ValueMapping vm,
                                          OpenJPAStateManager sm,
                                          JDBCStore store,
                                          JDBCFetchConfiguration fetch,
                                          Result res,
                                          Joins joins,
                                          Column[] cols,
                                          boolean objectValueRequiresLoad)
                                   throws java.sql.SQLException
Load the Object value from the given result.

Throws:
java.sql.SQLException

loadDataStore

public static java.lang.Object loadDataStore(ValueMapping vm,
                                             Result res,
                                             Joins joins,
                                             Column[] cols)
                                      throws java.sql.SQLException
Load the datastore value from the given result. This method does not process the loaded value through ValueHandler.toObjectValue(org.apache.openjpa.jdbc.meta.ValueMapping, java.lang.Object).

Throws:
java.sql.SQLException

toDataStoreValue

public static java.lang.Object toDataStoreValue(ValueMapping vm,
                                                java.lang.Object val,
                                                Column[] cols,
                                                JDBCStore store)
Convert the given object to its datastore value(s). Relation ids are converted to their final values immediately.


assertJoinable

public static void assertJoinable(ValueMapping vm)
Throw the proper exception if the given handler-controlled value represents an unjoinable relation.