Package org.apache.openjpa.meta
Class SequenceMetaData
java.lang.Object
org.apache.openjpa.meta.SequenceMetaData
- All Implemented Interfaces:
Serializable,SourceTracker,Closeable,Commentable,MetaDataContext
- Direct Known Subclasses:
SequenceMapping
public class SequenceMetaData
extends Object
implements SourceTracker, MetaDataContext, Closeable, Commentable, Serializable
Metadata about a named sequence.
- Since:
- 0.4.0
- Author:
- Abe White
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAllow facades to supply adapters from a spec sequence type to the OpenJPA sequence type. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault plugin alias name; every back end should have some 'native' sequence implementation.static final StringTime-based sequence values.static final StringSequence name that means to use the system default sequence.Fields inherited from interface org.apache.openjpa.lib.xml.Commentable
EMPTY_COMMENTSFields inherited from interface org.apache.openjpa.lib.meta.SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML -
Constructor Summary
ConstructorsConstructorDescriptionSequenceMetaData(String name, MetaDataRepository repos) Constructor; supply sequence name. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd standard properties to the given properties buffer.protected voidappendProperty(StringBuilder props, String name, int val) Add an int property to the buffer.protected voidappendProperty(StringBuilder props, String name, String val) Add a string property to the buffer.voidclose()Close user sequence instance.intSequence values to allocate, or -1 for default.intReturn the column number in the line of the file at which this instance was parsed.String[]Return comments, or empty array if none.intSequence increment, or -1 for default.intInitial sequence value, or -1 for default.getInstance(ClassLoader envLoader) Return the initialized sequence instance.intReturn the line number of the file at which this instance was parsed.getName()The sequence name.The owning repository.Return the domain-meaningful name of the resource that was loaded from this source.Native sequence name.A factory to transform spec sequences produced by user factories into the OpenJPA sequence type.Plugin string describing theSeq.Return the file from which this instance was parsed.Return the domain-dependent scope of this instance within its file.intReturn the type of source.intgetType()The sequence type.protected Seqinstantiate(ClassLoader envLoader) Create a new uninitialized instance of this sequence.protected PluginValuenewPluginValue(String property) Create a new plugin value for sequences.voidsetAllocate(int allocate) Sequence values to allocate, or -1 for default.voidsetCatalog(String catalog) voidsetColNumber(int colNum) voidsetComments(String[] comments) Set comments.voidsetIncrement(int increment) Sequence increment, or -1 for default.voidsetInitialValue(int initial) Initial sequence value, or -1 for default.voidsetLineNumber(int lineNum) voidvoidsetSequence(String sequence) Native sequence name.voidA factory to transform spec sequences produced by user factories into the OpenJPA sequence type.voidsetSequencePlugin(String plugin) Plugin string describing theSeq.voidvoidsetType(int type) The sequence type.toString()protected StringWraps property values that may contain spaces or other special characters in double quotes so they are processed as a single valued argument.
-
Field Details
-
NAME_SYSTEM
Sequence name that means to use the system default sequence.- See Also:
-
IMPL_NATIVE
Default plugin alias name; every back end should have some 'native' sequence implementation.- See Also:
-
IMPL_TIME
Time-based sequence values.- See Also:
-
-
Constructor Details
-
SequenceMetaData
Constructor; supply sequence name.
-
-
Method Details
-
getRepository
The owning repository.- Specified by:
getRepositoryin interfaceMetaDataContext
-
getName
The sequence name. -
getSourceFile
Description copied from interface:SourceTrackerReturn the file from which this instance was parsed.- Specified by:
getSourceFilein interfaceSourceTracker
-
getSourceScope
Description copied from interface:SourceTrackerReturn the domain-dependent scope of this instance within its file.- Specified by:
getSourceScopein interfaceSourceTracker
-
getSourceType
public int getSourceType()Description copied from interface:SourceTrackerReturn the type of source.- Specified by:
getSourceTypein interfaceSourceTracker
-
setSource
-
getLineNumber
public int getLineNumber()Description copied from interface:SourceTrackerReturn the line number of the file at which this instance was parsed.- Specified by:
getLineNumberin interfaceSourceTracker
-
setLineNumber
public void setLineNumber(int lineNum) -
getColNumber
public int getColNumber()Description copied from interface:SourceTrackerReturn the column number in the line of the file at which this instance was parsed.- Specified by:
getColNumberin interfaceSourceTracker
-
setColNumber
public void setColNumber(int colNum) -
getResourceName
Description copied from interface:SourceTrackerReturn the domain-meaningful name of the resource that was loaded from this source. I.e., if we had loaded the source for a Java class, this would return the name of the class.- Specified by:
getResourceNamein interfaceSourceTracker
-
getType
public int getType()The sequence type. -
setType
public void setType(int type) The sequence type. -
getSequence
Native sequence name. -
setSequence
Native sequence name. -
getIncrement
public int getIncrement()Sequence increment, or -1 for default. -
setIncrement
public void setIncrement(int increment) Sequence increment, or -1 for default. -
getAllocate
public int getAllocate()Sequence values to allocate, or -1 for default. -
setAllocate
public void setAllocate(int allocate) Sequence values to allocate, or -1 for default. -
getInitialValue
public int getInitialValue()Initial sequence value, or -1 for default. -
setInitialValue
public void setInitialValue(int initial) Initial sequence value, or -1 for default. -
getSequencePlugin
Plugin string describing theSeq. -
setSequencePlugin
Plugin string describing theSeq. -
getSequenceFactory
A factory to transform spec sequences produced by user factories into the OpenJPA sequence type. -
setSequenceFactory
A factory to transform spec sequences produced by user factories into the OpenJPA sequence type. -
getInstance
Return the initialized sequence instance. -
instantiate
Create a new uninitialized instance of this sequence. -
setSchema
-
getSchema
-
setCatalog
-
getCatalog
-
newPluginValue
Create a new plugin value for sequences. Returns a standardSeqValueby default. -
addStandardProperties
Add standard properties to the given properties buffer. -
wrapValue
Wraps property values that may contain spaces or other special characters in double quotes so they are processed as a single valued argument. -
appendProperty
Add a string property to the buffer. Nothing will be added if value is null or empty string. -
appendProperty
Add an int property to the buffer. Nothing will be added if value is -1. -
close
public void close()Close user sequence instance. -
toString
-
getComments
Description copied from interface:CommentableReturn comments, or empty array if none.- Specified by:
getCommentsin interfaceCommentable
-
setComments
Description copied from interface:CommentableSet comments.- Specified by:
setCommentsin interfaceCommentable
-