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

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.ColumnVersionStrategy
              extended by org.apache.openjpa.jdbc.meta.strats.TimestampVersionStrategy
All Implemented Interfaces:
Serializable, Strategy, VersionStrategy
Direct Known Subclasses:
NanoPrecisionTimestampVersionStrategy

public class TimestampVersionStrategy
extends ColumnVersionStrategy

Uses a timestamp for optimistic versioning.

Author:
Abe White
See Also:
Serialized Form

Field Summary
static String ALIAS
           
 
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
vers
 
Constructor Summary
TimestampVersionStrategy()
           
 
Method Summary
 String getAlias()
          Return the alias of this strategy.
 Map getBulkUpdateValues()
           
protected  int getJavaType()
          Return the code from JavaTypes for the version values this strategy uses.
protected  Object nextVersion(Object version)
          Return the next version given the current one, which may be null.
 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.ColumnVersionStrategy
checkVersion, compare, compare, compareVersion, delete, getColumnValue, getJavaType, insert, isSecondaryColumn, load, map, populateFromResult, select, update
 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
afterLoad, setVersion
 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
customDelete, customInsert, customUpdate, initialize, isCustomDelete, isCustomInsert, isCustomUpdate
 
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, initialize, isCustomDelete, isCustomInsert, isCustomUpdate
 

Field Detail

ALIAS

public static final String ALIAS
See Also:
Constant Field Values
Constructor Detail

TimestampVersionStrategy

public TimestampVersionStrategy()
Method Detail

getAlias

public String getAlias()
Description copied from interface: Strategy
Return the alias of this strategy. For custom strategies, return the full class name.

Specified by:
getAlias in interface Strategy
Overrides:
getAlias in class AbstractStrategy

getJavaType

protected int getJavaType()
Description copied from class: ColumnVersionStrategy
Return the code from JavaTypes for the version values this strategy uses. This method is only used during mapping installation.

Specified by:
getJavaType in class ColumnVersionStrategy

nextVersion

protected Object nextVersion(Object version)
Description copied from class: ColumnVersionStrategy
Return the next version given the current one, which may be null.

Specified by:
nextVersion in class ColumnVersionStrategy

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.