Class SequenceMapping

java.lang.Object
org.apache.openjpa.meta.SequenceMetaData
org.apache.openjpa.jdbc.meta.SequenceMapping
All Implemented Interfaces:
Serializable, SourceTracker, Closeable, Commentable, MetaDataContext

public class SequenceMapping extends SequenceMetaData
Specialization of sequence metadata for ORM.
Author:
Abe White
See Also:
  • Field Details

  • Constructor Details

    • SequenceMapping

      @Deprecated public SequenceMapping(String name, MappingRepository repos)
      Deprecated.
      Parameters:
      name -
      repos -
    • SequenceMapping

      public SequenceMapping(DBIdentifier name, MappingRepository repos)
      Sequence names are a kernel object so DBIdentifiers must be converted to strings
      Parameters:
      name -
      repos -
  • Method Details

    • getMappingFile

      public File getMappingFile()
      Allow sequence to have a mapping file separate from its metadata source file.
    • setMappingFile

      public void setMappingFile(File file)
      Allow sequence to have a mapping file separate from its metadata source file.
    • getTable

      @Deprecated public String getTable()
      Deprecated.
      Name of sequence table, if any.
    • getTableIdentifier

      public DBIdentifier getTableIdentifier()
    • setTable

      @Deprecated public void setTable(String table)
      Deprecated.
      Name of sequence table, if any.
    • setTableIdentifier

      public void setTableIdentifier(DBIdentifier table)
    • getSequenceColumn

      @Deprecated public String getSequenceColumn()
      Deprecated.
      Name of sequence column, if any.
    • getSequenceColumnIdentifier

      public DBIdentifier getSequenceColumnIdentifier()
    • setSequenceColumn

      @Deprecated public void setSequenceColumn(String sequenceColumn)
      Deprecated.
      Name of sequence column, if any.
    • setSequenceColumnIdentifier

      public void setSequenceColumnIdentifier(DBIdentifier sequenceColumn)
    • getPrimaryKeyColumn

      @Deprecated public String getPrimaryKeyColumn()
      Deprecated.
      Name of primary key column, if any.
    • getPrimaryKeyColumnIdentifier

      public DBIdentifier getPrimaryKeyColumnIdentifier()
    • setPrimaryKeyColumn

      @Deprecated public void setPrimaryKeyColumn(String primaryKeyColumn)
      Deprecated.
      Name of primary key column, if any.
    • setPrimaryKeyColumnIdentifier

      public void setPrimaryKeyColumnIdentifier(DBIdentifier primaryKeyColumn)
    • getPrimaryKeyValue

      public String getPrimaryKeyValue()
      Primary key value, if not auto-determined.
    • setPrimaryKeyValue

      public void setPrimaryKeyValue(String primaryKeyValue)
      Primary key value, if not auto-determined.
    • setUniqueColumns

      @Deprecated public void setUniqueColumns(String[] cols)
      Deprecated.
      Parameters:
      cols -
    • setUniqueColumnsIdentifier

      public void setUniqueColumnsIdentifier(DBIdentifier[] cols)
    • getUniqueColumns

      @Deprecated public String[] getUniqueColumns()
      Deprecated.
    • getUniqueColumnsIdentifier

      public DBIdentifier[] getUniqueColumnsIdentifier()
    • newPluginValue

      protected PluginValue newPluginValue(String property)
      Description copied from class: SequenceMetaData
      Create a new plugin value for sequences. Returns a standard SeqValue by default.
      Overrides:
      newPluginValue in class SequenceMetaData
    • instantiate

      protected Seq instantiate(ClassLoader envLoader)
      A generator that asks for a native sequence cannot be configured on a database that has no sequence objects: NativeJDBCSeq needs DBDictionary.nextSequenceQuery, and refuses to configure without it. Jakarta Persistence leaves the realisation of a generator to the provider, so rather than fail, such a generator is backed by a ValueTableJDBCSeq - a counter row keyed by the sequence name, which keeps the identifiers unique and honours initialValue and allocationSize.

      The substitution happens here, where the sequence is resolved, so the runtime and the mapping tool agree on which sequence backs the generator, and it produces a separate metadata instance rather than mutating this one, which is shared.

      Overrides:
      instantiate in class SequenceMetaData
      See Also:
    • getConfiguredSequence

      protected String getConfiguredSequence()
      A default sequence name, the generator name, is used as it is, unless the database rejects it.
      Overrides:
      getConfiguredSequence in class SequenceMetaData
      See Also:
    • addStandardProperties

      protected void addStandardProperties(StringBuilder props)
      Description copied from class: SequenceMetaData
      Add standard properties to the given properties buffer.
      Overrides:
      addStandardProperties in class SequenceMetaData
    • setUniqueConstraintName

      @Deprecated public void setUniqueConstraintName(String name)
      Deprecated.
      Parameters:
      name -
    • setUniqueConstraintIdentifier

      public void setUniqueConstraintIdentifier(DBIdentifier name)
    • getUniqueConstraintName

      @Deprecated public String getUniqueConstraintName()
      Deprecated.
    • getUniqueConstraintIdentifier

      public DBIdentifier getUniqueConstraintIdentifier()