kodo.jdbc.meta.strats
Class LockGroupStateComparisonVersionStrategy
java.lang.Object
   org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
       org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
           kodo.jdbc.meta.strats.LockGroupStateComparisonVersionStrategy
kodo.jdbc.meta.strats.LockGroupStateComparisonVersionStrategy
- All Implemented Interfaces: 
- Serializable, Strategy, VersionStrategy
- public class LockGroupStateComparisonVersionStrategy 
- extends AbstractVersionStrategy
Uses a state image to determine whether concurrency violations take
 place.
- See Also:
- Serialized Form
 
 
 
 
| Method Summary | 
|  void | afterLoad(OpenJPAStateManager sm,
          JDBCStore store)
 | 
|  boolean | checkVersion(OpenJPAStateManager sm,
             JDBCStore store,
             boolean updateVersion)
 | 
|  int | compareVersion(Object v1,
               Object v2)
 | 
|  void | customInsert(OpenJPAStateManager sm,
             JDBCStore store)This method is for class mappings that take over the insert
 process, but still want to use this indicator for optimistic locking.
 | 
|  LockGroupStateComparisonVersionStrategy.CustomUpdate | customUpdate(OpenJPAStateManager sm,
             JDBCStore store,
             Table table,
             boolean record)This method is for class mappings that take over the update
 process, but still want to use this indicator for optimistic locking.
 | 
|  String | getAlias()
 | 
|  void | insert(OpenJPAStateManager sm,
       JDBCStore store,
       RowManager rm)
 | 
|  void | map(boolean adapt)
 | 
|  void | update(OpenJPAStateManager sm,
       JDBCStore store,
       RowManager rm)
 | 
 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
 
ALIAS
public static final String ALIAS
- See Also:
- Constant Field Values
LockGroupStateComparisonVersionStrategy
public LockGroupStateComparisonVersionStrategy()
getAlias
public String getAlias()
- 
- Specified by:
- getAliasin interface- Strategy
- Overrides:
- getAliasin class- AbstractStrategy
 
- 
 
map
public void map(boolean adapt)
- 
- Specified by:
- mapin interface- Strategy
- Overrides:
- mapin class- AbstractStrategy
 
- 
 
insert
public void insert(OpenJPAStateManager sm,
                   JDBCStore store,
                   RowManager rm)
            throws SQLException
- 
- Specified by:
- insertin interface- Strategy
- Overrides:
- insertin class- AbstractStrategy
 
- 
- Throws:
- SQLException
 
customInsert
public void customInsert(OpenJPAStateManager sm,
                         JDBCStore store)
                  throws SQLException
- This method is for class mappings that take over the insert
 process, but still want to use this indicator for optimistic locking.
 
- 
- Specified by:
- customInsertin interface- Strategy
- Overrides:
- customInsertin class- AbstractStrategy
 
- 
- Throws:
- SQLException
 
update
public void update(OpenJPAStateManager sm,
                   JDBCStore store,
                   RowManager rm)
            throws SQLException
- 
- Specified by:
- updatein interface- Strategy
- Overrides:
- updatein class- AbstractStrategy
 
- 
- Throws:
- SQLException
 
customUpdate
public LockGroupStateComparisonVersionStrategy.CustomUpdate customUpdate(OpenJPAStateManager sm,
                                                                         JDBCStore store,
                                                                         Table table,
                                                                         boolean record)
                                                                  throws SQLException
- This method is for class mappings that take over the update
 process, but still want to use this indicator for optimistic locking.
 
- 
- Parameters:
- sm- the instance to test
- store- store manager context
- table- only state image values in this table will be tested;
 if the custom mapping uses different updates for
 different tables, this method can be called multiple
 times for the multiple tables
- record- set this parameter to true the last time you call
 this method, so the indicator can setup the next
 version of the given state manager
- Returns:
- a LockGroupStateComparisonVersionStrategy.CustomUpdatewhose getSQL method yields a
 boolean SQL expression that tests whether the current
 record is equal to our recorded state image, and whose
 setParameters method parameterizes the given prepared
 statement with the values used in the above boolean
 expression
- Throws:
- SQLException
 
afterLoad
public void afterLoad(OpenJPAStateManager sm,
                      JDBCStore store)
- 
- Specified by:
- afterLoadin interface- VersionStrategy
- Overrides:
- afterLoadin class- AbstractVersionStrategy
 
- 
 
checkVersion
public boolean checkVersion(OpenJPAStateManager sm,
                            JDBCStore store,
                            boolean updateVersion)
                     throws SQLException
- 
- Specified by:
- checkVersionin interface- VersionStrategy
- Overrides:
- checkVersionin class- AbstractVersionStrategy
 
- 
- Throws:
- SQLException
 
compareVersion
public int compareVersion(Object v1,
                          Object v2)
- 
- Specified by:
- compareVersionin interface- VersionStrategy
- Overrides:
- compareVersionin class- AbstractVersionStrategy
 
- 
 
Copyright 2001-2006 BEA Systems, Inc. All Rights Reserved.