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

java.lang.Object
  extended by org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
      extended by org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
          extended by org.apache.openjpa.jdbc.meta.strats.SuperclassVersionStrategy
All Implemented Interfaces:
Serializable, Strategy, VersionStrategy

public class SuperclassVersionStrategy
extends AbstractVersionStrategy

Version strategy that delegates to the suerpclass version.

Author:
Abe White
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
vers
 
Constructor Summary
SuperclassVersionStrategy()
           
 
Method Summary
 void afterLoad(OpenJPAStateManager sm, JDBCStore store)
          This method is called after data is loaded into the instance, in case the version indicator works off of a state image.
 boolean checkVersion(OpenJPAStateManager sm, JDBCStore store, boolean updateVersion)
          Checks the version of the given state manager with the version stored in memory.
 int compareVersion(Object v1, Object v2)
           
 Map getBulkUpdateValues()
           
 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
load, select, setVersion
 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
 
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, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
 

Constructor Detail

SuperclassVersionStrategy

public SuperclassVersionStrategy()
Method Detail

afterLoad

public void afterLoad(OpenJPAStateManager sm,
                      JDBCStore store)
Description copied from interface: VersionStrategy
This method is called after data is loaded into the instance, in case the version indicator works off of a state image.

Specified by:
afterLoad in interface VersionStrategy
Overrides:
afterLoad in class AbstractVersionStrategy

checkVersion

public boolean checkVersion(OpenJPAStateManager sm,
                            JDBCStore store,
                            boolean updateVersion)
                     throws SQLException
Description copied from interface: VersionStrategy
Checks the version of the given state manager with the version stored in memory.

Specified by:
checkVersion in interface VersionStrategy
Overrides:
checkVersion in class AbstractVersionStrategy
Returns:
true if the in-memory version was up-to-date, false otherwise
Throws:
SQLException

compareVersion

public int compareVersion(Object v1,
                          Object v2)
Specified by:
compareVersion in interface VersionStrategy
Overrides:
compareVersion in class AbstractVersionStrategy
See Also:
StoreManager.compareVersion(org.apache.openjpa.kernel.OpenJPAStateManager, java.lang.Object, java.lang.Object)

getBulkUpdateValues

public Map getBulkUpdateValues()
Specified by:
getBulkUpdateValues in interface VersionStrategy
Overrides:
getBulkUpdateValues in class AbstractVersionStrategy
Returns:
a Map specifying how to update each version column during a bulk update.


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.