Class MultiColumnVersionStrategy
- 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
-
- org.apache.openjpa.jdbc.meta.strats.MultiColumnVersionStrategy
-
- All Implemented Interfaces:
java.io.Serializable
,Strategy
,VersionStrategy
public class MultiColumnVersionStrategy extends NumberVersionStrategy
Uses multiple version numbers spanning multiple columns for optimistic versioning.- Since:
- 1.3.0
- Author:
- Pinaki Poddar
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ALIAS
-
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
vers
-
-
Constructor Summary
Constructors Constructor Description MultiColumnVersionStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlias()
Return the alias of this strategy.java.lang.Number[]
getInitialValues()
Return the initial values for version columns.protected int
getJavaType()
Return the code fromJavaTypes
for the version values this strategy uses.protected int
getJavaType(int i)
Return the code fromJavaTypes
for the version value this given column index uses.void
initialize()
Perform caching and other initialization operations.protected java.lang.Object
nextVersion(java.lang.Object version)
Return the next version given the current one, which may be null.void
setInitialValues(java.lang.Number[] initial)
Set the initial value for version columns.-
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.NumberVersionStrategy
getBulkUpdateValues, getInitialValue, setInitialValue
-
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.ColumnVersionStrategy
checkVersion, compare, compare, compareVersion, delete, 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, 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, isCustomDelete, isCustomInsert, isCustomUpdate
-
-
-
-
Field Detail
-
ALIAS
public static final java.lang.String ALIAS
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize()
Description copied from interface:Strategy
Perform caching and other initialization operations. This method is called afterStrategy.map(boolean)
, and after all related components have been mapped as well.- Specified by:
initialize
in interfaceStrategy
- Overrides:
initialize
in classAbstractStrategy
-
setInitialValues
public void setInitialValues(java.lang.Number[] initial)
Set the initial value for version columns. Defaults to 1 for each column.
-
getInitialValues
public java.lang.Number[] getInitialValues()
Return the initial values for version columns. Defaults to 1 for each column.
-
getAlias
public java.lang.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 interfaceStrategy
- Overrides:
getAlias
in classNumberVersionStrategy
-
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.- Overrides:
getJavaType
in classNumberVersionStrategy
-
getJavaType
protected int getJavaType(int i)
Description copied from class:ColumnVersionStrategy
Return the code fromJavaTypes
for the version value this given column index uses. Only used if the version strategy employs more than one column.- Overrides:
getJavaType
in classColumnVersionStrategy
-
nextVersion
protected java.lang.Object nextVersion(java.lang.Object version)
Description copied from class:ColumnVersionStrategy
Return the next version given the current one, which may be null.- Overrides:
nextVersion
in classNumberVersionStrategy
-
-