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:
Serializable
,Strategy
,VersionStrategy
Uses multiple version numbers spanning multiple columns for optimistic
versioning.
- Since:
- 1.3.0
- Author:
- Pinaki Poddar
- 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.Number[]
Return the initial values for version columns.protected int
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
Perform caching and other initialization operations.protected Object
nextVersion
(Object version) Return the next version given the current one, which may be null.void
setInitialValues
(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 Details
-
ALIAS
- See Also:
-
-
Constructor Details
-
MultiColumnVersionStrategy
public MultiColumnVersionStrategy()
-
-
Method Details
-
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
Set the initial value for version columns. Defaults to 1 for each column. -
getInitialValues
Return the initial values for version columns. Defaults to 1 for each column. -
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
Description copied from class:ColumnVersionStrategy
Return the next version given the current one, which may be null.- Overrides:
nextVersion
in classNumberVersionStrategy
-