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
Modifier and TypeClassDescriptionstatic interface
Allow facades to supply adapters from a spec sequence type to the OpenJPA sequence type. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default plugin alias name; every back end should have some 'native' sequence implementation.static final String
Time-based sequence values.static final String
Sequence name that means to use the system default sequence.Fields inherited from interface org.apache.openjpa.lib.xml.Commentable
EMPTY_COMMENTS
Fields inherited from interface org.apache.openjpa.lib.meta.SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML
-
Constructor Summary
ConstructorDescriptionSequenceMetaData
(String name, MetaDataRepository repos) Constructor; supply sequence name. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Add standard properties to the given properties buffer.protected void
appendProperty
(StringBuilder props, String name, int val) Add an int property to the buffer.protected void
appendProperty
(StringBuilder props, String name, String val) Add a string property to the buffer.void
close()
Close user sequence instance.int
Sequence values to allocate, or -1 for default.int
Return the column number in the line of the file at which this instance was parsed.String[]
Return comments, or empty array if none.int
Sequence increment, or -1 for default.int
Initial sequence value, or -1 for default.getInstance
(ClassLoader envLoader) Return the initialized sequence instance.int
Return 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.int
Return the type of source.int
getType()
The sequence type.protected Seq
instantiate
(ClassLoader envLoader) Create a new uninitialized instance of this sequence.protected PluginValue
newPluginValue
(String property) Create a new plugin value for sequences.void
setAllocate
(int allocate) Sequence values to allocate, or -1 for default.void
setCatalog
(String catalog) void
setColNumber
(int colNum) void
setComments
(String[] comments) Set comments.void
setIncrement
(int increment) Sequence increment, or -1 for default.void
setInitialValue
(int initial) Initial sequence value, or -1 for default.void
setLineNumber
(int lineNum) void
void
setSequence
(String sequence) Native sequence name.void
A factory to transform spec sequences produced by user factories into the OpenJPA sequence type.void
setSequencePlugin
(String plugin) Plugin string describing theSeq
.void
void
setType
(int type) The sequence type.toString()
protected String
Wraps 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:
getRepository
in interfaceMetaDataContext
-
getName
The sequence name. -
getSourceFile
Description copied from interface:SourceTracker
Return the file from which this instance was parsed.- Specified by:
getSourceFile
in interfaceSourceTracker
-
getSourceScope
Description copied from interface:SourceTracker
Return the domain-dependent scope of this instance within its file.- Specified by:
getSourceScope
in interfaceSourceTracker
-
getSourceType
public int getSourceType()Description copied from interface:SourceTracker
Return the type of source.- Specified by:
getSourceType
in interfaceSourceTracker
-
setSource
-
getLineNumber
public int getLineNumber()Description copied from interface:SourceTracker
Return the line number of the file at which this instance was parsed.- Specified by:
getLineNumber
in interfaceSourceTracker
-
setLineNumber
public void setLineNumber(int lineNum) -
getColNumber
public int getColNumber()Description copied from interface:SourceTracker
Return the column number in the line of the file at which this instance was parsed.- Specified by:
getColNumber
in interfaceSourceTracker
-
setColNumber
public void setColNumber(int colNum) -
getResourceName
Description copied from interface:SourceTracker
Return 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:
getResourceName
in 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 standardSeqValue
by 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:Commentable
Return comments, or empty array if none.- Specified by:
getComments
in interfaceCommentable
-
setComments
Description copied from interface:Commentable
Set comments.- Specified by:
setComments
in interfaceCommentable
-