|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.util.sequence.SequenceManagerHelper
public class SequenceManagerHelper
Helper class for SequenceManager implementations.
Field Summary | |
---|---|
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 Summary | |
---|---|
SequenceManagerHelper()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public SequenceManagerHelper()
Method Detail |
---|
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 field
PersistenceBrokerException
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |