Class NumberVersionStrategy
java.lang.Object
org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
org.apache.openjpa.jdbc.meta.strats.ColumnVersionStrategy
org.apache.openjpa.jdbc.meta.strats.NumberVersionStrategy
- All Implemented Interfaces:
Serializable
,Strategy
,VersionStrategy
- Direct Known Subclasses:
MultiColumnVersionStrategy
Uses a version number for optimistic versioning.
- Author:
- Abe White
- See Also:
-
Field Summary
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
vers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAlias()
Return the alias of this strategy.int
Return the initial value for version column.protected int
Return the code fromJavaTypes
for the version values this strategy uses.protected Object
nextVersion
(Object version) Return the next version given the current one, which may be null.void
setInitialValue
(int initial) Set the initial value for version column.Methods inherited from class org.apache.openjpa.jdbc.meta.strats.ColumnVersionStrategy
checkVersion, compare, compare, compareVersion, delete, getJavaType, insert, load, load, map, 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 Details
-
ALIAS
- See Also:
-
-
Constructor Details
-
NumberVersionStrategy
public NumberVersionStrategy()
-
-
Method Details
-
setInitialValue
public void setInitialValue(int initial) Set the initial value for version column. Defaults to 1. -
getInitialValue
public int getInitialValue()Return the initial value for version column. Defaults to 1. -
getAlias
Description copied from interface:Strategy
Return the alias of this strategy. For custom strategies, return the full class name.- Specified by:
getAlias
in interfaceStrategy
- Overrides:
getAlias
in classAbstractStrategy
-
getJavaType
protected int getJavaType()Description copied from class:ColumnVersionStrategy
Return the code fromJavaTypes
for the version values this strategy uses. This method is only used during mapping installation.- Specified by:
getJavaType
in classColumnVersionStrategy
-
nextVersion
Description copied from class:ColumnVersionStrategy
Return the next version given the current one, which may be null.- Specified by:
nextVersion
in classColumnVersionStrategy
-
getBulkUpdateValues
- Specified by:
getBulkUpdateValues
in interfaceVersionStrategy
- Overrides:
getBulkUpdateValues
in classAbstractVersionStrategy
- Returns:
- a Map<Column,Object> specifying how to update each version column during a bulk update.
-