public class SequenceConfig
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static SequenceConfig |
DEFAULT
Default configuration used if null is passed to methods that create a
cursor.
|
Constructor and Description |
---|
SequenceConfig()
An instance created using the default constructor is initialized with
the system's default settings.
|
Modifier and Type | Method and Description |
---|---|
SequenceConfig |
clone()
Returns a copy of this configuration object.
|
boolean |
getAllowCreate()
Returns true if the
Database.openSequence method is configured to create the sequence if it
does not already exist. |
boolean |
getAutoCommitNoSync()
Returns true if the auto-commit operations on the sequence are configure
to not flush the transaction log..
|
int |
getCacheSize()
Returns the number of elements cached by a sequence handle..
|
boolean |
getDecrement()
Returns true if the sequence is configured to decrement.
|
boolean |
getExclusiveCreate()
Returns true if the
Database.openSequence method is configured to fail if the database
already exists. |
long |
getInitialValue()
Returns the initial value for a sequence..
|
long |
getRangeMax()
Returns the maximum value for the sequence.
|
long |
getRangeMin()
Returns the minimum value for the sequence.
|
boolean |
getWrap()
Returns true if the sequence will wrap around when it is incremented
(decremented) past the specified maximum (minimum) value.
|
SequenceConfig |
setAllowCreate(boolean allowCreate)
Configures the
Database.openSequence method to create the sequence if it does not
already exist. |
SequenceConfig |
setAutoCommitNoSync(boolean autoCommitNoSync)
Configures auto-commit operations on the sequence to not flush the
transaction log.
|
SequenceConfig |
setCacheSize(int cacheSize)
Set the Configure the number of elements cached by a sequence handle.
|
SequenceConfig |
setDecrement(boolean decrement)
Specifies that the sequence should be decremented.
|
SequenceConfig |
setExclusiveCreate(boolean exclusiveCreate)
Configures the
Database.openSequence method to fail if the database already exists. |
SequenceConfig |
setInitialValue(long initialValue)
Sets the initial value for a sequence.
|
SequenceConfig |
setRange(long min,
long max)
Configures a sequence range.
|
SequenceConfig |
setWrap(boolean wrap)
Specifies that the sequence should wrap around when it is incremented
(decremented) past the specified maximum (minimum) value.
|
java.lang.String |
toString()
Returns the values for each configuration attribute.
|
public static final SequenceConfig DEFAULT
public SequenceConfig()
public SequenceConfig setAllowCreate(boolean allowCreate)
Database.openSequence
method to create the sequence if it does not
already exist.
The default value is false.
This method may be called at any time during the life of the application.
allowCreate
- If true, configure the Database.openSequence
method to
create the sequence if it does not already exist.public boolean getAllowCreate()
Database.openSequence
method is configured to create the sequence if it
does not already exist.
This method may be called at any time during the life of the application.
Database.openSequence
method is configured to create the sequence if it
does not already exist.public SequenceConfig setCacheSize(int cacheSize)
The default value is zero.
This method may be called at any time during the life of the application.
cacheSize
- The number of elements cached by a sequence handle.
May not be larger than the size of the range defined by setRange(long, long)
.public int getCacheSize()
This method may be called at any time during the life of the application.
public SequenceConfig setDecrement(boolean decrement)
The default value is false.
This method may be called at any time during the life of the application.
decrement
- If true, specify that the sequence should be
decremented.public boolean getDecrement()
This method may be called at any time during the life of the application.
public SequenceConfig setExclusiveCreate(boolean exclusiveCreate)
Database.openSequence
method to fail if the database already exists.
The default value is false.
This method may be called at any time during the life of the application.
exclusiveCreate
- If true, configure the Database.openSequence
method to
fail if the database already exists.public boolean getExclusiveCreate()
Database.openSequence
method is configured to fail if the database
already exists.
This method may be called at any time during the life of the application.
Database.openSequence
method is configured to fail if the database
already exists.public SequenceConfig setInitialValue(long initialValue)
The default initial value is zero.
This call is only effective when the sequence is being created.
This method may be called at any time during the life of the application.
initialValue
- The initial value for a sequence. Must be within
the range minimum and maximum values, inclusive.public long getInitialValue()
This method may be called at any time during the life of the application.
public SequenceConfig setAutoCommitNoSync(boolean autoCommitNoSync)
The default value is false.
This method may be called at any time during the life of the application.
autoCommitNoSync
- If true, configure auto-commit operations on
the sequence to not flush the transaction log.public boolean getAutoCommitNoSync()
This method may be called at any time during the life of the application.
public SequenceConfig setRange(long min, long max)
The default minimum is Long.MIN_VALUE
and the default maximum
is Long.MAX_VALUE
.
min
- The minimum value for the sequence. Must be less than max.max
- The maximum value for the sequence. Must be greater than
min.public long getRangeMin()
This method may be called at any time during the life of the application.
public long getRangeMax()
This method may be called at any time during the life of the application.
public SequenceConfig setWrap(boolean wrap)
The default value is false.
This method may be called at any time during the life of the application.
wrap
- If true, specify that the sequence should wrap around when
it is incremented (decremented) past the specified maximum (minimum)
value.public boolean getWrap()
This method may be called at any time during the life of the application.
public SequenceConfig clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.