Class MultiColumnVersionStrategy

All Implemented Interfaces:
Serializable, Strategy, VersionStrategy

public class MultiColumnVersionStrategy extends NumberVersionStrategy
Uses multiple version numbers spanning multiple columns for optimistic versioning.
Since:
1.3.0
Author:
Pinaki Poddar
See Also:
  • Field Details

  • Constructor Details

    • MultiColumnVersionStrategy

      public MultiColumnVersionStrategy()
  • Method Details

    • initialize

      public void initialize()
      Description copied from interface: Strategy
      Perform caching and other initialization operations. This method is called after Strategy.map(boolean), and after all related components have been mapped as well.
      Specified by:
      initialize in interface Strategy
      Overrides:
      initialize in class AbstractStrategy
    • setInitialValues

      public void setInitialValues(Number[] initial)
      Set the initial value for version columns. Defaults to 1 for each column.
    • getInitialValues

      public Number[] getInitialValues()
      Return the initial values for version columns. Defaults to 1 for each column.
    • getAlias

      public String getAlias()
      Description copied from interface: Strategy
      Return the alias of this strategy. For custom strategies, return the full class name.
      Specified by:
      getAlias in interface Strategy
      Overrides:
      getAlias in class NumberVersionStrategy
    • getJavaType

      protected int getJavaType()
      Description copied from class: ColumnVersionStrategy
      Return the code from JavaTypes for the version values this strategy uses. This method is only used during mapping installation.
      Overrides:
      getJavaType in class NumberVersionStrategy
    • getJavaType

      protected int getJavaType(int i)
      Description copied from class: ColumnVersionStrategy
      Return the code from JavaTypes for the version value this given column index uses. Only used if the version strategy employs more than one column.
      Overrides:
      getJavaType in class ColumnVersionStrategy
    • nextVersion

      protected Object nextVersion(Object version)
      Description copied from class: ColumnVersionStrategy
      Return the next version given the current one, which may be null.
      Overrides:
      nextVersion in class NumberVersionStrategy