Class TimestampVersionStrategy
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.TimestampVersionStrategy
- All Implemented Interfaces:
Serializable, Strategy, VersionStrategy
- Direct Known Subclasses:
NanoPrecisionTimestampVersionStrategy
Uses a timestamp for optimistic versioning.
- Author:
- Abe White
- See Also:
-
Field Summary
FieldsFields inherited from class AbstractVersionStrategy
vers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TimestampThe current time, which the next version is derived from.getAlias()Return the alias of this strategy.protected intReturn the code fromJavaTypesfor the version values this strategy uses.voidinsert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) Set values for the mapping into the proper rows.protected ObjectnextVersion(Object version) Return the next version given the current one, which may be null.voidupdate(OpenJPAStateManager sm, JDBCStore store, RowManager rm) Set values for the mapping into the proper rows.Methods inherited from class ColumnVersionStrategy
checkVersion, compare, compare, compareVersion, delete, getJavaType, load, load, map, selectMethods inherited from class AbstractVersionStrategy
afterLoad, setVersionMethods inherited from class AbstractStrategy
customDelete, customInsert, customUpdate, initialize, isCustomDelete, isCustomInsert, isCustomUpdateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Strategy
customDelete, customInsert, customUpdate, initialize, isCustomDelete, isCustomInsert, isCustomUpdate
-
Field Details
-
ALIAS
- See Also:
-
-
Constructor Details
-
TimestampVersionStrategy
public TimestampVersionStrategy()
-
-
Method Details
-
getAlias
-
getJavaType
protected int getJavaType()Description copied from class:ColumnVersionStrategyReturn the code fromJavaTypesfor the version values this strategy uses. This method is only used during mapping installation.- Specified by:
getJavaTypein classColumnVersionStrategy
-
nextVersion
Description copied from class:ColumnVersionStrategyReturn the next version given the current one, which may be null.- Specified by:
nextVersionin classColumnVersionStrategy
-
currentTimestamp
The current time, which the next version is derived from. -
insert
Description copied from interface:StrategySet values for the mapping into the proper rows. For class mappings, this method will be called only after the corresponding method has been called for all fields of this mapping.- Specified by:
insertin interfaceStrategy- Overrides:
insertin classColumnVersionStrategy- Throws:
SQLException
-
update
Description copied from interface:StrategySet values for the mapping into the proper rows.- Specified by:
updatein interfaceStrategy- Overrides:
updatein classColumnVersionStrategy- Throws:
SQLException- See Also:
-
getBulkUpdateValues
- Specified by:
getBulkUpdateValuesin interfaceVersionStrategy- Overrides:
getBulkUpdateValuesin classAbstractVersionStrategy- Returns:
- a
MapMap<Column, Object>specifying how to update each version column during a bulk update.
-