org.apache.ojb.broker.util.sequence
Class SequenceManagerNativeImpl

java.lang.Object
  extended by org.apache.ojb.broker.util.sequence.AbstractSequenceManager
      extended by org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl
All Implemented Interfaces:
SequenceManager

public class SequenceManagerNativeImpl
extends AbstractSequenceManager

Sequence manager implementation using native database Identity columns (like MySQL, MSSQL, ...). For proper work some specific metadata settings needed:

Note: Make sure that the DB generated identity columns represent values > 0, because negative values intern used by this implementation and 0 could cause problems with primitive FK fields.

Implementation configuration properties:

Property Key Property Values
no properties to set

Limitations:



Version:
$Id: SequenceManagerNativeImpl.java,v 1.1 2007-08-24 22:17:29 ewestfal Exp $
Author:
Travis Reeder, Armin Waibel

Field Summary
 
Fields inherited from class org.apache.ojb.broker.util.sequence.AbstractSequenceManager
GLOBAL_SEQUENCE_NAME, PROPERTY_AUTO_NAMING
 
Constructor Summary
SequenceManagerNativeImpl(PersistenceBroker broker)
           
 
Method Summary
 void afterStore(JdbcAccess dbAccess, ClassDescriptor cld, Object obj)
          noop
protected  long getUniqueLong(FieldDescriptor field)
          returns a negative value
protected  String lastInsertSelect(String tableName)
           
 
Methods inherited from class org.apache.ojb.broker.util.sequence.AbstractSequenceManager
calculateSequenceName, getBrokerForClass, getConfigurationProperties, getConfigurationProperty, getPlatform, getUniqueValue, setConfigurationProperties, setConfigurationProperty, setReferenceFKs, useAutoNaming
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceManagerNativeImpl

public SequenceManagerNativeImpl(PersistenceBroker broker)
Method Detail

afterStore

public void afterStore(JdbcAccess dbAccess,
                       ClassDescriptor cld,
                       Object obj)
                throws SequenceManagerException
Description copied from class: AbstractSequenceManager
noop

Specified by:
afterStore in interface SequenceManager
Overrides:
afterStore in class AbstractSequenceManager
Parameters:
dbAccess - Current used JdbcAccess instance
cld - Descriptor for specified object
obj - The object to associate with identity value
Throws:
SequenceManagerException

lastInsertSelect

protected String lastInsertSelect(String tableName)

getUniqueLong

protected long getUniqueLong(FieldDescriptor field)
                      throws SequenceManagerException
returns a negative value

Specified by:
getUniqueLong in class AbstractSequenceManager
Throws:
SequenceManagerException


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.