public class SequenceManagerHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_SEQ_AS
Property name used to configure sequence manager implementations.
|
static java.lang.String |
PROP_SEQ_CACHE
Property name used to configure sequence manager implementations.
|
static java.lang.String |
PROP_SEQ_CYCLE
Property name used to configure sequence manager implementations.
|
static java.lang.String |
PROP_SEQ_INCREMENT_BY
Property name used to configure sequence manager implementations.
|
static java.lang.String |
PROP_SEQ_MAX_VALUE
Property name used to configure sequence manager implementations.
|
static java.lang.String |
PROP_SEQ_MIN_VALUE
Property name used to configure sequence manager implementations.
|
static java.lang.String |
PROP_SEQ_ORDER
Property name used to configure sequence manager implementations.
|
static java.lang.String |
PROP_SEQ_START
Property name used to configure sequence manager implementations.
|
static java.lang.String |
PROP_SEQ_START_OLD
Deprecated.
use
PROP_SEQ_START instead. |
Constructor and Description |
---|
SequenceManagerHelper() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
buildSequenceName(PersistenceBroker brokerForClass,
FieldDescriptor field,
boolean autoNaming)
Returns a unique sequence name (unique across all extents).
|
static long |
getMaxForExtent(PersistenceBroker brokerForClass,
FieldDescriptor field)
Lookup all tables associated with given class (search all extent classes)
to find the current maximum value for the given field.
|
static long |
getMaxId(PersistenceBroker brokerForClass,
java.lang.Class topLevel,
FieldDescriptor original)
Search down all extent classes and return max of all found
PK values.
|
static long |
getMaxIdForClass(PersistenceBroker brokerForClass,
ClassDescriptor cldForOriginalOrExtent,
FieldDescriptor original)
lookup current maximum value for a single field in
table the given class descriptor was associated.
|
static java.lang.String |
getSeqAsValue(java.util.Properties prop)
Database sequence properties helper method.
|
static java.lang.Long |
getSeqCacheValue(java.util.Properties prop)
Database sequence properties helper method.
|
static java.lang.Boolean |
getSeqCycleValue(java.util.Properties prop)
Database sequence properties helper method.
|
static java.lang.Long |
getSeqIncrementBy(java.util.Properties prop)
Database sequence properties helper method.
|
static java.lang.Long |
getSeqMaxValue(java.util.Properties prop)
Database sequence properties helper method.
|
static java.lang.Long |
getSeqMinValue(java.util.Properties prop)
Database sequence properties helper method.
|
static java.lang.Boolean |
getSeqOrderValue(java.util.Properties prop)
Database sequence properties helper method.
|
static java.lang.Long |
getSeqStart(java.util.Properties prop)
Database sequence properties helper method.
|
public static final java.lang.String PROP_SEQ_AS
public static final java.lang.String PROP_SEQ_START_OLD
PROP_SEQ_START
instead.public static final java.lang.String PROP_SEQ_START
public static final java.lang.String PROP_SEQ_INCREMENT_BY
public static final java.lang.String PROP_SEQ_MAX_VALUE
public static final java.lang.String PROP_SEQ_MIN_VALUE
public static final java.lang.String PROP_SEQ_CYCLE
public static final java.lang.String PROP_SEQ_CACHE
public static final java.lang.String PROP_SEQ_ORDER
public static java.lang.String buildSequenceName(PersistenceBroker brokerForClass, FieldDescriptor field, boolean autoNaming) throws SequenceManagerException
If the method argument 'autoNaming' is true, the generated
sequence name will be set in the given field descriptor
using FieldDescriptor.setSequenceName(java.lang.String)
to speed up sequence name lookup in future calls.
brokerForClass
- current used PB instancefield
- target fieldautoNaming
- if 'false' no auto sequence name was build and
a exception was throw if none could be found in field.SequenceManagerException
public static long getMaxForExtent(PersistenceBroker brokerForClass, FieldDescriptor field) throws PersistenceBrokerException
long
autoincrement fields.brokerForClass
- persistence broker instance match the database of the
given field/classfield
- the target fieldPersistenceBrokerException
public static long getMaxId(PersistenceBroker brokerForClass, java.lang.Class topLevel, FieldDescriptor original) throws PersistenceBrokerException
PersistenceBrokerException
public static long getMaxIdForClass(PersistenceBroker brokerForClass, ClassDescriptor cldForOriginalOrExtent, FieldDescriptor original) throws PersistenceBrokerException
PersistenceBrokerException
public static java.lang.Long getSeqStart(java.util.Properties prop)
prop
- The Properties
instance to use.public static java.lang.Long getSeqIncrementBy(java.util.Properties prop)
prop
- The Properties
instance to use.public static java.lang.Long getSeqMaxValue(java.util.Properties prop)
prop
- The Properties
instance to use.public static java.lang.Long getSeqMinValue(java.util.Properties prop)
prop
- The Properties
instance to use.public static java.lang.Long getSeqCacheValue(java.util.Properties prop)
prop
- The Properties
instance to use.public static java.lang.Boolean getSeqCycleValue(java.util.Properties prop)
prop
- The Properties
instance to use.public static java.lang.Boolean getSeqOrderValue(java.util.Properties prop)
prop
- The Properties
instance to use.public static java.lang.String getSeqAsValue(java.util.Properties prop)
prop
- The Properties
instance to use.(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30