Class AbstractVersionStrategy
java.lang.Object
org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
- All Implemented Interfaces:
Serializable,Strategy,VersionStrategy
- Direct Known Subclasses:
ColumnVersionStrategy,NoneVersionStrategy,StateComparisonVersionStrategy,SuperclassVersionStrategy
No-op strategy for easy extension.
- Author:
- Abe White
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterLoad(OpenJPAStateManager sm, JDBCStore store) This method is called after data is loaded into the instance, in case the version indicator works off of a state image.booleancheckVersion(OpenJPAStateManager sm, JDBCStore store, boolean updateVersion) Checks the version of the given state manager with the version stored in memory.intcompareVersion(Object v1, Object v2) load(OpenJPAStateManager sm, JDBCStore store, Result res) Load data.load(OpenJPAStateManager sm, JDBCStore store, Result res, Joins joins) Load data.booleanselect(Select sel, ClassMapping mapping) Select the data for this indicator.voidsetVersion(Version owner) Set the version that uses this strategy.Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openjpa.jdbc.meta.Strategy
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
-
Field Details
-
vers
The owning version.
-
-
Constructor Details
-
AbstractVersionStrategy
public AbstractVersionStrategy()
-
-
Method Details
-
setVersion
Description copied from interface:VersionStrategySet the version that uses this strategy. This will be called before use.- Specified by:
setVersionin interfaceVersionStrategy
-
select
Description copied from interface:VersionStrategySelect the data for this indicator.- Specified by:
selectin interfaceVersionStrategymapping- the known base class being selected; this may not be the base class in the inheritance hierarchy- Returns:
- true if anything was selected; false otherwise
-
load
Description copied from interface:VersionStrategyLoad data.- Specified by:
loadin interfaceVersionStrategy- Throws:
SQLException
-
load
public Object load(OpenJPAStateManager sm, JDBCStore store, Result res, Joins joins) throws SQLException Description copied from interface:VersionStrategyLoad data.- Specified by:
loadin interfaceVersionStrategy- Throws:
SQLException
-
afterLoad
Description copied from interface:VersionStrategyThis method is called after data is loaded into the instance, in case the version indicator works off of a state image.- Specified by:
afterLoadin interfaceVersionStrategy
-
checkVersion
public boolean checkVersion(OpenJPAStateManager sm, JDBCStore store, boolean updateVersion) throws SQLException Description copied from interface:VersionStrategyChecks the version of the given state manager with the version stored in memory.- Specified by:
checkVersionin interfaceVersionStrategy- Returns:
- true if the in-memory version was up-to-date, false otherwise
- Throws:
SQLException
-
compareVersion
- Specified by:
compareVersionin interfaceVersionStrategy- See Also:
-
getBulkUpdateValues
- Specified by:
getBulkUpdateValuesin interfaceVersionStrategy- Returns:
- a Map<Column,Object> specifying how to update each version column during a bulk update.
-