org.apache.openjpa.jdbc.meta.strats
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:
- Strategy, VersionStrategy
public class NumberVersionStrategy
- extends ColumnVersionStrategy
Uses a version number for optimistic versioning.
- Author:
- Abe White
Field Summary |
static java.lang.String |
ALIAS
|
Method Summary |
java.lang.String |
getAlias()
Return the alias of this strategy. |
int |
getInitialValue()
Return the initial value for version column. |
protected int |
getJavaType()
Return the code from JavaTypes for the version values this
strategy uses. |
protected java.lang.Object |
nextVersion(java.lang.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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALIAS
public static final java.lang.String ALIAS
- See Also:
- Constant Field Values
NumberVersionStrategy
public NumberVersionStrategy()
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
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 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 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.
- Specified by:
nextVersion
in class ColumnVersionStrategy
Copyright © 2006 Apache Software Foundation. All Rights Reserved.