public class SequenceMetaData extends Object implements SourceTracker, MetaDataContext, Closeable, Commentable, Serializable
Modifier and Type | Class and Description |
---|---|
static interface |
SequenceMetaData.SequenceFactory
Allow facades to supply adapters from a spec sequence type to the
OpenJPA sequence type.
|
Modifier and Type | Field and Description |
---|---|
static String |
IMPL_NATIVE
Default plugin alias name; every back end should have some 'native'
sequence implementation.
|
static String |
IMPL_TIME
Time-based sequence values.
|
static String |
NAME_SYSTEM
Sequence name that means to use the system default sequence.
|
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML
EMPTY_COMMENTS
Constructor and Description |
---|
SequenceMetaData(String name,
MetaDataRepository repos)
Constructor; supply sequence name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addStandardProperties(StringBuilder props)
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 |
getAllocate()
Sequence values to allocate, or -1 for default.
|
String |
getCatalog() |
int |
getColNumber()
Return the column number in the line of the file at which this
instance was parsed.
|
String[] |
getComments()
Return comments, or empty array if none.
|
int |
getIncrement()
Sequence increment, or -1 for default.
|
int |
getInitialValue()
Initial sequence value, or -1 for default.
|
Seq |
getInstance(ClassLoader envLoader)
Return the initialized sequence instance.
|
int |
getLineNumber()
Return the line number of the file at which this instance was parsed.
|
String |
getName()
The sequence name.
|
MetaDataRepository |
getRepository()
The owning repository.
|
String |
getResourceName()
Return the domain-meaningful name of the resource that was loaded
from this source.
|
String |
getSchema() |
String |
getSequence()
Native sequence name.
|
SequenceMetaData.SequenceFactory |
getSequenceFactory()
A factory to transform spec sequences produced by user factories into
the OpenJPA sequence type.
|
String |
getSequencePlugin()
Plugin string describing the
Seq . |
File |
getSourceFile()
Return the file from which this instance was parsed.
|
Object |
getSourceScope()
Return the domain-dependent scope of this instance within its file.
|
int |
getSourceType()
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 |
setSchema(String schema) |
void |
setSequence(String sequence)
Native sequence name.
|
void |
setSequenceFactory(SequenceMetaData.SequenceFactory factory)
A factory to transform spec sequences produced by user factories into
the OpenJPA sequence type.
|
void |
setSequencePlugin(String plugin)
Plugin string describing the
Seq . |
void |
setSource(File file,
Object scope,
int srcType) |
void |
setType(int type)
The sequence type.
|
String |
toString() |
protected String |
wrapValue(String value)
Wraps property values that may contain spaces or other special characters
in double quotes so they are processed as a single valued argument.
|
public static final String NAME_SYSTEM
public static final String IMPL_NATIVE
public static final String IMPL_TIME
public SequenceMetaData(String name, MetaDataRepository repos)
public MetaDataRepository getRepository()
getRepository
in interface MetaDataContext
public String getName()
public File getSourceFile()
SourceTracker
getSourceFile
in interface SourceTracker
public Object getSourceScope()
SourceTracker
getSourceScope
in interface SourceTracker
public int getSourceType()
SourceTracker
getSourceType
in interface SourceTracker
public int getLineNumber()
SourceTracker
getLineNumber
in interface SourceTracker
public void setLineNumber(int lineNum)
public int getColNumber()
SourceTracker
getColNumber
in interface SourceTracker
public void setColNumber(int colNum)
public String getResourceName()
SourceTracker
getResourceName
in interface SourceTracker
public int getType()
public void setType(int type)
public String getSequence()
public void setSequence(String sequence)
public int getIncrement()
public void setIncrement(int increment)
public int getAllocate()
public void setAllocate(int allocate)
public int getInitialValue()
public void setInitialValue(int initial)
public SequenceMetaData.SequenceFactory getSequenceFactory()
public void setSequenceFactory(SequenceMetaData.SequenceFactory factory)
public Seq getInstance(ClassLoader envLoader)
protected Seq instantiate(ClassLoader envLoader)
public void setSchema(String schema)
public String getSchema()
public void setCatalog(String catalog)
public String getCatalog()
protected PluginValue newPluginValue(String property)
SeqValue
by default.protected void addStandardProperties(StringBuilder props)
protected String wrapValue(String value)
protected void appendProperty(StringBuilder props, String name, String val)
protected void appendProperty(StringBuilder props, String name, int val)
public String[] getComments()
Commentable
getComments
in interface Commentable
public void setComments(String[] comments)
Commentable
setComments
in interface Commentable
Copyright © 2006–2019 Apache Software Foundation. All rights reserved.