| java.lang.Object org.jpox.metadata.MetaData org.jpox.metadata.VersionMetaData
VersionMetaData | public class VersionMetaData extends MetaData (Code) | | Three common strategies for versioning instances are supported by standard
metadata. These include state-comparison, timestamp, and version-number.
- State-comparison involves comparing the values in specific columns to
determine if the database row was changed.
- Timestamp involves comparing the value in a date-time column in the table.
The first time in a transaction the row is updated, the timestamp value is updated to the current time.
- Version-number involves comparing the value in a numeric column in the table.
The first time in a transaction the row is updated, the version-number column value is incremented.
There are two forms of version storage.
- The JDO2 method of adding a surrogate column, using the column/columns/index info in this class
- The JPA1 method of using an existing field/method. This uses the "fieldName info only
version: $Revision: 1.13 $ |
columns | final protected List columns(Code) | | ColumnMetaData for the version column.
|
fieldName | protected String fieldName(Code) | | Name of the field that contains the version (if not generating a surrogate column).
|
VersionMetaData | public VersionMetaData(String versionStrategy, String columnName, String indexed)(Code) | | Constructor for a surrogate version added by JPOX (JDO).
Parameters: versionStrategy - Strategy for versioning Parameters: columnName - Column name Parameters: indexed - The indexed tag |
VersionMetaData | public VersionMetaData(String versionStrategy, String fieldName)(Code) | | Constructor for a version stored in a field (JPA).
Parameters: versionStrategy - Strategy for versioning Parameters: fieldName - name of the field/property which stores the version |
addColumn | public void addColumn(ColumnMetaData colmd)(Code) | | Add a new ColumnMetaData element
Parameters: colmd - The ColumnMetaData to add |
getColumnMetaData | final public ColumnMetaData[] getColumnMetaData()(Code) | | Acessor for the columns
Returns the columnMetaData. |
getFieldName | final public String getFieldName()(Code) | | Accessor for the name of the field/property that stores the version.
Name of the field/property storing the version. |
getIndexMetaData | final public IndexMetaData getIndexMetaData()(Code) | | Accessor for indexMetaData
Returns the indexMetaData. |
getVersionStrategy | final public VersionStrategy getVersionStrategy()(Code) | | Accessor for versionStrategy
Returns the versionStrategy. |
initialise | public void initialise()(Code) | | Initialisation method. This should be called AFTER using the populate
method if you are going to use populate. It creates the internal
convenience arrays etc needed for normal operation.
|
setIndexMetaData | final public void setIndexMetaData(IndexMetaData indexMetaData)(Code) | | Mutator for the index MetaData
Parameters: indexMetaData - The indexMetaData to set. |
toString | public String toString(String prefix, String indent)(Code) | | Returns a string representation of the object using a prefix
This can be used as part of a facility to output a MetaData file.
Parameters: prefix - prefix string Parameters: indent - indent string a string representation of the object. |
|
|