Class VersionMetaData

  • All Implemented Interfaces:

    public class VersionMetaData
    extends MetaData
    Three common strategies for versioning instances are supported by standard metadata.
    • 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.

    • Surrogate column - the default in JDO, using the column/columns/index info in this class
    • Defined member - the default in JPA. This uses the "memberName" info only
    See Also:
    Serialized Form
    • Field Detail

      • versionStrategy

        protected VersionStrategy versionStrategy
        strategy for generating the version.
      • columnName

        protected String columnName
        column name
      • columnMetaData

        protected ColumnMetaData columnMetaData
        Contains the metadata for column.
      • indexMetaData

        protected IndexMetaData indexMetaData
        Detail of any indexing of the version column (optional).
      • memberName

        protected String memberName
        Name of the member that contains the version (if not generating a surrogate column).
    • Constructor Detail

      • VersionMetaData

        public VersionMetaData()
    • Method Detail

      • initialise

        public void initialise​(ClassLoaderResolver clr)
        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.
        initialise in class MetaData
      • setColumnMetaData

        public void setColumnMetaData​(ColumnMetaData columnMetaData)
        Mutator for column MetaData.
        columnMetaData - The column MetaData to set.
      • newColumnMetaData

        public ColumnMetaData newColumnMetaData()
        Method to create a new ColumnMetaData, add it, and return it.
        The Column metadata
      • getIndexMetaData

        public final IndexMetaData getIndexMetaData()
      • setIndexMetaData

        public final void setIndexMetaData​(IndexMetaData indexMetaData)
      • newIndexMetaData

        public IndexMetaData newIndexMetaData()
        Method to create a new Index metadata, add it, and return it.
        The Index metadata
      • getColumnName

        public String getColumnName()
      • getMemberName

        public final String getMemberName()