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

java.lang.Object
  extended by org.apache.ojb.broker.util.sequence.AbstractSequenceManager
All Implemented Interfaces:
SequenceManager
Direct Known Subclasses:
SequenceManagerHighLowImpl, SequenceManagerInMemoryImpl, SequenceManagerMSSQLGuidImpl, SequenceManagerNativeImpl, SequenceManagerNextValImpl, SequenceManagerStoredProcedureImpl, SequenceManagerTransientImpl

public abstract class AbstractSequenceManager
extends java.lang.Object
implements SequenceManager

A base class for sequence manager implementations.
All sequence manager implementations need a constructor with a PersistenceBroker argument used by the SequenceManagerFactory.

Version:
$Id: AbstractSequenceManager.java 365232 2005-12-21 22:36:07Z tomdz $
Author:
Armin Waibel

Field Summary
static java.lang.String PROPERTY_AUTO_NAMING
           
 
Constructor Summary
AbstractSequenceManager(PersistenceBroker broker)
          Constructor used by SequenceManagerFactory
 
Method Summary
 void afterStore(JdbcAccess dbAccess, ClassDescriptor cld, java.lang.Object obj)
          noop
 java.lang.String calculateSequenceName(FieldDescriptor field)
           
 PersistenceBroker getBrokerForClass()
           
 java.util.Properties getConfigurationProperties()
           
 java.lang.String getConfigurationProperty(java.lang.String key, java.lang.String defaultValue)
           
 Platform getPlatform()
           
 java.lang.Object getUniqueValue(FieldDescriptor field)
          Returns a unique object for the given field attribute.
 void setConfigurationProperties(java.util.Properties prop)
           
 void setConfigurationProperty(java.lang.String key, java.lang.String value)
           
 void setReferenceFKs(java.lang.Object obj, ClassDescriptor cld)
          noop
 boolean useAutoNaming()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_AUTO_NAMING

public static final java.lang.String PROPERTY_AUTO_NAMING
See Also:
Constant Field Values
Constructor Detail

AbstractSequenceManager

public AbstractSequenceManager(PersistenceBroker broker)
Constructor used by SequenceManagerFactory

Parameters:
broker - PB instance to perform the id generation.
Method Detail

getPlatform

public Platform getPlatform()

getBrokerForClass

public PersistenceBroker getBrokerForClass()

getConfigurationProperties

public java.util.Properties getConfigurationProperties()

setConfigurationProperties

public void setConfigurationProperties(java.util.Properties prop)

getConfigurationProperty

public java.lang.String getConfigurationProperty(java.lang.String key,
                                                 java.lang.String defaultValue)

setConfigurationProperty

public void setConfigurationProperty(java.lang.String key,
                                     java.lang.String value)

useAutoNaming

public boolean useAutoNaming()

calculateSequenceName

public java.lang.String calculateSequenceName(FieldDescriptor field)
                                       throws SequenceManagerException
Throws:
SequenceManagerException

getUniqueValue

public java.lang.Object getUniqueValue(FieldDescriptor field)
                                throws SequenceManagerException
Returns a unique object for the given field attribute. The returned value takes in account the jdbc-type and the FieldConversion.sql2java() conversion defined for field. The returned object is unique accross all tables in the extent of class the field belongs to.

Specified by:
getUniqueValue in interface SequenceManager
Throws:
SequenceManagerException

afterStore

public void afterStore(JdbcAccess dbAccess,
                       ClassDescriptor cld,
                       java.lang.Object obj)
                throws SequenceManagerException
noop

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

setReferenceFKs

public void setReferenceFKs(java.lang.Object obj,
                            ClassDescriptor cld)
                     throws SequenceManagerException
noop

Throws:
SequenceManagerException


(C) 2002 - 2006 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