org.apache.openjpa.jdbc.schema
Class Sequence

java.lang.Object
  extended by org.apache.openjpa.jdbc.schema.Sequence
All Implemented Interfaces:
Serializable, Comparable, SourceTracker

public class Sequence
extends Object
implements Comparable, SourceTracker

Represents a database sequence.

Author:
Abe White
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.openjpa.lib.meta.SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML
 
Constructor Summary
Sequence()
          Default constructor.
Sequence(String name, Schema schema)
          Constructor.
 
Method Summary
 int compareTo(Object other)
           
 void deref()
           
 int getAllocate()
          The sequence's cache size.
 String getFullName()
          Return the sequence name, including schema, using '.' as the catalog separator.
 int getIncrement()
          The sequence's increment.
 int getInitialValue()
          The sequence's initial value.
 String getName()
          Return the name of the sequence.
 int getRefCount()
           
 String getResourceName()
          Return the domain-meaningful name of the resource that was loaded from this source.
 Schema getSchema()
          Return the schema for the sequence.
 String getSchemaName()
          The sequence's schema name.
 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.
 void ref()
           
 void setAllocate(int cache)
          The sequence's cache size.
 void setIncrement(int increment)
          The sequence's increment.
 void setInitialValue(int initial)
          The sequence's initial value.
 void setName(String name)
          Set the name of the sequence.
 void setSchemaName(String name)
          The sequence's schema name.
 void setSource(File source, int srcType)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sequence

public Sequence()
Default constructor.


Sequence

public Sequence(String name,
                Schema schema)
Constructor.

Parameters:
name - the sequence name
schema - the sequence schema
Method Detail

getSchema

public Schema getSchema()
Return the schema for the sequence.


getSchemaName

public String getSchemaName()
The sequence's schema name.


setSchemaName

public void setSchemaName(String name)
The sequence's schema name. You can only call this method on sequences whose schema object is not set.


getName

public String getName()
Return the name of the sequence.


setName

public void setName(String name)
Set the name of the sequence. This method can only be called on sequences that are not part of a schema.


getFullName

public String getFullName()
Return the sequence name, including schema, using '.' as the catalog separator.


getInitialValue

public int getInitialValue()
The sequence's initial value.


setInitialValue

public void setInitialValue(int initial)
The sequence's initial value.


getIncrement

public int getIncrement()
The sequence's increment.


setIncrement

public void setIncrement(int increment)
The sequence's increment.


getAllocate

public int getAllocate()
The sequence's cache size.


setAllocate

public void setAllocate(int cache)
The sequence's cache size.


getSourceFile

public File getSourceFile()
Description copied from interface: SourceTracker
Return the file from which this instance was parsed.

Specified by:
getSourceFile in interface SourceTracker

getSourceScope

public Object getSourceScope()
Description copied from interface: SourceTracker
Return the domain-dependent scope of this instance within its file.

Specified by:
getSourceScope in interface SourceTracker

getSourceType

public int getSourceType()
Description copied from interface: SourceTracker
Return the type of source.

Specified by:
getSourceType in interface SourceTracker

setSource

public void setSource(File source,
                      int srcType)

getResourceName

public String 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 interface SourceTracker

compareTo

public int compareTo(Object other)
Specified by:
compareTo in interface Comparable

toString

public String toString()
Overrides:
toString in class Object

getRefCount

public int getRefCount()

ref

public void ref()

deref

public void deref()


Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.