Class SequenceMapping
java.lang.Object
org.apache.openjpa.meta.SequenceMetaData
org.apache.openjpa.jdbc.meta.SequenceMapping
- All Implemented Interfaces:
Serializable, SourceTracker, Closeable, Commentable, MetaDataContext
Specialization of sequence metadata for ORM.
- Author:
- Abe White
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class SequenceMetaData
SequenceMetaData.SequenceFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringClassTableJDBCSeqalias.static final StringTableJDBCSeqalias.static final StringValueTableJDBCSeqalias.Fields inherited from class SequenceMetaData
IMPL_NATIVE, IMPL_TIME, NAME_SYSTEMFields inherited from interface Commentable
EMPTY_COMMENTSFields inherited from interface SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML -
Constructor Summary
ConstructorsConstructorDescriptionSequenceMapping(String name, MappingRepository repos) Deprecated.SequenceMapping(DBIdentifier name, MappingRepository repos) Sequence names are a kernel object so DBIdentifiers must be converted to strings -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd standard properties to the given properties buffer.protected StringA default sequence name, the generator name, is used as it is, unless the database rejects it.Allow sequence to have a mapping file separate from its metadata source file.Deprecated.Primary key value, if not auto-determined.Deprecated.getTable()Deprecated.String[]Deprecated.Deprecated.protected Seqinstantiate(ClassLoader envLoader) A generator that asks for a native sequence cannot be configured on a database that has no sequence objects:NativeJDBCSeqneedsDBDictionary.nextSequenceQuery, and refuses to configure without it.protected PluginValuenewPluginValue(String property) Create a new plugin value for sequences.voidsetMappingFile(File file) Allow sequence to have a mapping file separate from its metadata source file.voidsetPrimaryKeyColumn(String primaryKeyColumn) Deprecated.voidsetPrimaryKeyColumnIdentifier(DBIdentifier primaryKeyColumn) voidsetPrimaryKeyValue(String primaryKeyValue) Primary key value, if not auto-determined.voidsetSequenceColumn(String sequenceColumn) Deprecated.voidsetSequenceColumnIdentifier(DBIdentifier sequenceColumn) voidDeprecated.voidsetTableIdentifier(DBIdentifier table) voidsetUniqueColumns(String[] cols) Deprecated.voidvoidvoidDeprecated.Methods inherited from class SequenceMetaData
appendProperty, appendProperty, close, getAllocate, getCatalog, getColNumber, getComments, getIncrement, getInitialValue, getInstance, getLineNumber, getName, getRepository, getResourceName, getSchema, getSequence, getSequenceFactory, getSequencePlugin, getSourceFile, getSourceScope, getSourceType, getType, isDefaultSequence, setAllocate, setCatalog, setColNumber, setComments, setDefaultSequence, setIncrement, setInitialValue, setLineNumber, setSchema, setSequence, setSequenceFactory, setSequencePlugin, setSource, setType, toString, wrapValue
-
Field Details
-
IMPL_VALUE_TABLE
-
IMPL_TABLE
-
IMPL_CLASS_TABLE
-
-
Constructor Details
-
SequenceMapping
Deprecated.- Parameters:
name-repos-
-
SequenceMapping
Sequence names are a kernel object so DBIdentifiers must be converted to strings- Parameters:
name-repos-
-
-
Method Details
-
getMappingFile
Allow sequence to have a mapping file separate from its metadata source file. -
setMappingFile
Allow sequence to have a mapping file separate from its metadata source file. -
getTable
-
getTableIdentifier
-
setTable
-
setTableIdentifier
-
getSequenceColumn
-
getSequenceColumnIdentifier
-
setSequenceColumn
Deprecated.Name of sequence column, if any. -
setSequenceColumnIdentifier
-
getPrimaryKeyColumn
-
getPrimaryKeyColumnIdentifier
-
setPrimaryKeyColumn
Deprecated.Name of primary key column, if any. -
setPrimaryKeyColumnIdentifier
-
getPrimaryKeyValue
Primary key value, if not auto-determined. -
setPrimaryKeyValue
Primary key value, if not auto-determined. -
setUniqueColumns
-
setUniqueColumnsIdentifier
-
getUniqueColumns
Deprecated. -
getUniqueColumnsIdentifier
-
newPluginValue
Description copied from class:SequenceMetaDataCreate a new plugin value for sequences. Returns a standardSeqValueby default.- Overrides:
newPluginValuein classSequenceMetaData
-
instantiate
A generator that asks for a native sequence cannot be configured on a database that has no sequence objects:NativeJDBCSeqneedsDBDictionary.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 aValueTableJDBCSeq- a counter row keyed by the sequence name, which keeps the identifiers unique and honoursinitialValueandallocationSize.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:
instantiatein classSequenceMetaData- See Also:
-
getConfiguredSequence
A default sequence name, the generator name, is used as it is, unless the database rejects it.- Overrides:
getConfiguredSequencein classSequenceMetaData- See Also:
-
addStandardProperties
Description copied from class:SequenceMetaDataAdd standard properties to the given properties buffer.- Overrides:
addStandardPropertiesin classSequenceMetaData
-
setUniqueConstraintName
-
setUniqueConstraintIdentifier
-
getUniqueConstraintName
Deprecated. -
getUniqueConstraintIdentifier
-