public class Version extends Object implements VersionStrategy, MetaDataContext, MetaDataModes
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY| Constructor and Description |
|---|
Version(ClassMapping mapping)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterLoad(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.
|
boolean |
checkVersion(OpenJPAStateManager sm,
JDBCStore store,
boolean updateVersion)
Checks the version of the given state manager with the version
stored in memory.
|
void |
clearMapping()
Clear mapping information, including strategy.
|
int |
compareVersion(Object v1,
Object v2) |
void |
customDelete(OpenJPAStateManager sm,
JDBCStore store)
Override this method to customize flushing this mapping.
|
void |
customInsert(OpenJPAStateManager sm,
JDBCStore store)
Override this method to customize flushing this mapping.
|
void |
customUpdate(OpenJPAStateManager sm,
JDBCStore store)
Override this method to customize flushing this mapping.
|
void |
delete(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set the where values appropriately to delete the proper instance,
and set all relations on non-secondary tables as updates.
|
String |
getAlias()
Return the alias of this strategy.
|
Map<Column,?> |
getBulkUpdateValues() |
ClassMapping |
getClassMapping()
Return the owning mapping.
|
ColumnIO |
getColumnIO()
I/O information on the version columns.
|
Column[] |
getColumns()
Columns used for versioning.
|
Index |
getIndex()
Index on the version columns, or null if none.
|
VersionMappingInfo |
getMappingInfo()
Raw mapping data.
|
MappingRepository |
getMappingRepository() |
MetaDataRepository |
getRepository()
Access metadata repository.
|
int |
getResolve()
Resolve mode.
|
VersionStrategy |
getStrategy()
The strategy used for versioning.
|
void |
initialize()
Perform caching and other initialization operations.
|
void |
insert(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set values for the mapping into the proper rows.
|
Boolean |
isCustomDelete(OpenJPAStateManager sm,
JDBCStore store)
Return
Boolean.FALSE if this mapping does not customize the
delete process, Boolean.TRUE if it does, or null if it does
customize the delete, but also relies on the standard delete method
being called. |
Boolean |
isCustomInsert(OpenJPAStateManager sm,
JDBCStore store)
Return
Boolean.FALSE if this mapping does not customize the
insert process, Boolean.TRUE if it does, or null if it does
customize the insert, but also relies on the standard insert method
being called. |
Boolean |
isCustomUpdate(OpenJPAStateManager sm,
JDBCStore store)
Return
Boolean.FALSE if this mapping does not customize the
update process, Boolean.TRUE if it does, or null if it does
customize the update, but also relies on the standard update method
being called. |
Object |
load(OpenJPAStateManager sm,
JDBCStore store,
Result res)
Load data.
|
Object |
load(OpenJPAStateManager sm,
JDBCStore store,
Result res,
Joins joins)
Load data.
|
void |
map(boolean adapt)
Map the owning mapping using this strategy.
|
void |
refSchemaComponents()
Increment the reference count of used schema components.
|
boolean |
resolve(int mode)
Resolve mapping information.
|
boolean |
select(Select sel,
ClassMapping mapping)
Select the data for this indicator.
|
void |
setColumnIO(ColumnIO io)
I/O information on the version columns.
|
void |
setColumns(Column[] cols)
Columns used for versioning.
|
void |
setIndex(Index idx)
Index on the version columns, or null if none.
|
void |
setResolve(int mode)
Resolve mode.
|
void |
setResolve(int mode,
boolean on)
Resolve mode.
|
void |
setStrategy(VersionStrategy strategy,
Boolean adapt)
The strategy used for versioning.
|
void |
setVersion(Version owner)
Set the version that uses this strategy.
|
void |
syncMappingInfo()
Update
MappingInfo with our current mapping information. |
String |
toString() |
void |
update(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set values for the mapping into the proper rows.
|
public Version(ClassMapping mapping)
public MetaDataRepository getRepository()
MetaDataContextgetRepository in interface MetaDataContextpublic MappingRepository getMappingRepository()
public ClassMapping getClassMapping()
public VersionStrategy getStrategy()
public void setStrategy(VersionStrategy strategy, Boolean adapt)
adapt
parameter determines whether to adapt when mapping the strategy;
use null if the strategy should not be mapped.public VersionMappingInfo getMappingInfo()
public Column[] getColumns()
public void setColumns(Column[] cols)
public ColumnIO getColumnIO()
public void setColumnIO(ColumnIO io)
public Index getIndex()
public void setIndex(Index idx)
public void refSchemaComponents()
public void clearMapping()
public void syncMappingInfo()
MappingInfo with our current mapping information.public int getResolve()
public void setResolve(int mode)
public void setResolve(int mode,
boolean on)
public boolean resolve(int mode)
public String getAlias()
Strategypublic void map(boolean adapt)
Strategypublic void initialize()
StrategyStrategy.map(boolean), and after all related components have been
mapped as well.initialize in interface Strategypublic void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategyinsert in interface StrategySQLExceptionpublic void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategyupdate in interface StrategySQLExceptionStrategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategydelete in interface StrategySQLExceptionStrategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)public Boolean isCustomInsert(OpenJPAStateManager sm, JDBCStore store)
StrategyBoolean.FALSE if this mapping does not customize the
insert process, Boolean.TRUE if it does, or null if it does
customize the insert, but also relies on the standard insert method
being called. Implement the Strategy.customInsert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore) method
to implement the custom insertion behavior.isCustomInsert in interface Strategypublic Boolean isCustomUpdate(OpenJPAStateManager sm, JDBCStore store)
StrategyBoolean.FALSE if this mapping does not customize the
update process, Boolean.TRUE if it does, or null if it does
customize the update, but also relies on the standard update method
being called. Implement the Strategy.customUpdate(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore) method
to override the default update behavior.isCustomUpdate in interface Strategypublic Boolean isCustomDelete(OpenJPAStateManager sm, JDBCStore store)
StrategyBoolean.FALSE if this mapping does not customize the
delete process, Boolean.TRUE if it does, or null if it does
customize the delete, but also relies on the standard delete method
being called. Implement the Strategy.customDelete(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore) method
to override the default deletion behavior.isCustomDelete in interface Strategypublic void customInsert(OpenJPAStateManager sm, JDBCStore store) throws SQLException
StrategycustomInsert in interface StrategySQLExceptionpublic void customUpdate(OpenJPAStateManager sm, JDBCStore store) throws SQLException
StrategycustomUpdate in interface StrategySQLExceptionpublic void customDelete(OpenJPAStateManager sm, JDBCStore store) throws SQLException
StrategycustomDelete in interface StrategySQLExceptionpublic void setVersion(Version owner)
VersionStrategysetVersion in interface VersionStrategypublic boolean select(Select sel, ClassMapping mapping)
VersionStrategyselect in interface VersionStrategymapping - the known base class being selected; this may
not be the base class in the inheritance hierarchypublic Object load(OpenJPAStateManager sm, JDBCStore store, Result res) throws SQLException
VersionStrategyload in interface VersionStrategySQLExceptionpublic Object load(OpenJPAStateManager sm, JDBCStore store, Result res, Joins joins) throws SQLException
VersionStrategyload in interface VersionStrategySQLExceptionpublic void afterLoad(OpenJPAStateManager sm, JDBCStore store)
VersionStrategyafterLoad in interface VersionStrategypublic boolean checkVersion(OpenJPAStateManager sm, JDBCStore store, boolean updateVersion) throws SQLException
VersionStrategycheckVersion in interface VersionStrategySQLExceptionpublic int compareVersion(Object v1, Object v2)
compareVersion in interface VersionStrategyStoreManager.compareVersion(org.apache.openjpa.kernel.OpenJPAStateManager, java.lang.Object, java.lang.Object)public Map<Column,?> getBulkUpdateValues()
getBulkUpdateValues in interface VersionStrategyCopyright © 2006–2022 Apache Software Foundation. All rights reserved.