db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r495677 [9/9] - in /db/ojb/trunk: ./ profile/ src/java/org/apache/ojb/broker/ src/java/org/apache/ojb/broker/accesslayer/ src/java/org/apache/ojb/broker/accesslayer/batch/ src/java/org/apache/ojb/broker/accesslayer/sql/ src/java/org/apache/...
Date Fri, 12 Jan 2007 18:19:45 GMT
Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/UnwrapHelper.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/UnwrapHelper.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/UnwrapHelper.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/UnwrapHelper.java Fri Jan 12 10:19:39 2007
@@ -28,6 +28,7 @@
 import org.apache.commons.lang.builder.ToStringStyle;
 import org.apache.ojb.broker.util.logging.Logger;
 import org.apache.ojb.broker.util.logging.LoggerFactory;
+import org.apache.ojb.broker.OJBRuntimeException;
 
 /**
  * This a helper class make available methods to unwrap {@link java.sql.Connection} and
@@ -50,12 +51,41 @@
 {
     private Logger log = LoggerFactory.getLogger(UnwrapHelper.class);
 
-    private static final int UNWARP_CONNECTION = 1;
-    private static final int UNWARP_STATEMENT = 2;
-    private static final Object[] EMPTY_ARG = new Object[]{};
-    public static final Class[] EMPTY_TYPE = new Class[]{};
-    public static final Integer TYPE_METHOD = new Integer(5);
-    public static final Integer TYPE_FIELD = new Integer(6);
+    protected static final int UNWARP_CONNECTION = 1;
+    protected static final int UNWARP_STATEMENT = 2;
+    protected static final Object[] EMPTY_ARG = new Object[]{};
+    protected static final Class[] EMPTY_TYPE = new Class[]{};
+    /**
+     * Indicate method access in unwrap pattern.
+     * @see #addUnwrapPattern(Object[])
+     */
+    public static final Access TYPE_METHOD = new Access(){
+        public boolean isField()
+        {
+            return false;
+        }
+
+        public boolean isMethod()
+        {
+            return true;
+        }
+    };
+    /**
+     * Indicate field access in unwrap pattern.
+     * @see #addUnwrapPattern(Object[])
+     */
+    public static final Access TYPE_FIELD = new Access(){
+        public boolean isField()
+        {
+            return true;
+        }
+
+        public boolean isMethod()
+        {
+            return false;
+        }
+    };
+
     /**
      * Represents the information of how to unwrap wrapped {@link java.sql.Connection}
      * and {@link java.sql.PreparedStatement} instances of popular connection-pool libraries,
@@ -93,6 +123,7 @@
      * </code>
      */
     private static final Object[][] predefinedPatterns = {
+        {"OJB wrapper", TYPE_METHOD, EMPTY_TYPE, "getInnermostDelegate", null, null, null},
         {"common-DBCP", TYPE_METHOD, EMPTY_TYPE, "getInnermostDelegate", TYPE_METHOD, EMPTY_TYPE, "getInnermostDelegate"},
         {"JBoss", TYPE_METHOD, EMPTY_TYPE, "getUnderlyingConnection", TYPE_METHOD, EMPTY_TYPE, "getUnderlyingStatement"},
         {"enhydra.XAPool", TYPE_FIELD, null, "con", TYPE_FIELD, null, "ps"},
@@ -204,6 +235,17 @@
      */
     public void addUnwrapPattern(final Object[] pattern)
     {
+        // check method/field access
+        if(pattern[1] != null && !(pattern[1] instanceof Access))
+        {
+            throw new OJBRuntimeException("Can't detect access method, pattern[1] is not of type Access, please use " +
+                    "UnwarpHelper#Type_XYZ fields to specify type. Pattern: " + ArrayUtils.toString(pattern));
+        }
+        if(pattern[4] != null && !(pattern[4] instanceof Access))
+        {
+            throw new OJBRuntimeException("Can't detect access method, pattern[4] is not of type Access, please use " +
+                    "UnwarpHelper#Type_XYZ fields to specify type. Pattern: " + ArrayUtils.toString(pattern));
+        }
         // check connection method argument
         Object argType = pattern[2];
         if(argType == null)
@@ -284,7 +326,7 @@
 
     protected Object loopUnwrap(Object[][] patterns, final Class classToMatch, final Object toUnwrap, final int type, final List matchedPatterns)
     {
-        if(classToMatch == null)
+        if(classToMatch == null || toUnwrap == null)
         {
             return null;
         }
@@ -464,5 +506,11 @@
             buf.append(ArrayUtils.toString(unwrapPatterns[i]));
         }
         return buf.toString();
+    }
+
+    static interface Access
+    {
+        boolean isMethod();
+        boolean isField();
     }
 }

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/dbhandling/DdlUtilslDatabaseHandling.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/dbhandling/DdlUtilslDatabaseHandling.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/dbhandling/DdlUtilslDatabaseHandling.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/dbhandling/DdlUtilslDatabaseHandling.java Fri Jan 12 10:19:39 2007
@@ -350,7 +350,9 @@
     {
         try
         {
-            getPlatform().alterTables(_schema, true, true, true);
+            // TODO: Need to modify method arguments to support current version
+            // getPlatform().alterTables(_schema, true, true, true);
+            getPlatform().alterTables(_schema, true);
         }
         catch (Exception ex)
         {
@@ -415,7 +417,9 @@
     {
         try
         {
-            writer.write(getPlatform().getAlterTablesSql(_schema, true, true, true));
+            // TODO: Need to modify method arguments to support current version
+            //writer.write(getPlatform().getAlterTablesSql(_schema, true, true, true));
+            writer.write(getPlatform().getAlterTablesSql(_schema));
         }
         catch (Exception ex)
         {

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/AbstractSequenceManager.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/AbstractSequenceManager.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/AbstractSequenceManager.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/AbstractSequenceManager.java Fri Jan 12 10:19:39 2007
@@ -31,7 +31,6 @@
  * All sequence manager implementations need a constructor
  * with a PersistenceBroker argument.
  *
- * @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
  * @version $Id$
  */
 public abstract class AbstractSequenceManager implements SequenceManager
@@ -40,34 +39,24 @@
     public static final String PROPERTY_AUTO_NAMING = "seq.autoNaming";
     protected static final String GLOBAL_SEQUENCE_NAME = "ojb.global.sequence";
 
-    private PersistenceBrokerInternal brokerForClass;
     private Platform platform;
-    private Properties configurationProperties;
+    private SequenceDescriptor sd;
 
     /**
-     * Constructor with a PersistenceBroker argument.
-     *
-     * @param broker  PB instance to perform the
-     * id generation.
+     * Constructor used to create a new instance.
      */
-    public AbstractSequenceManager(PersistenceBrokerInternal broker)
+    public AbstractSequenceManager(Platform platform, SequenceDescriptor sequenceDescriptor)
     {
-        this.brokerForClass = broker;
-        this.configurationProperties = new Properties();
-        this.platform = brokerForClass.serviceConnectionManager().getSupportedPlatform();
-        SequenceDescriptor sd = brokerForClass.serviceConnectionManager().
-                getConnectionDescriptor().getSequenceDescriptor();
-        if (sd != null)
-        {
-            this.configurationProperties.putAll(sd.getAttributes());
-        }
+        this.sd = sequenceDescriptor;
+        this.platform = platform;
     }
 
     /**
      * returns a unique long value for field.
      * the returned number is unique accross all tables in the extent of clazz.
      */
-    abstract protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException;
+    abstract protected long getUniqueLong(final PersistenceBrokerInternal broker, final FieldDescriptor field)
+            throws SequenceManagerException;
 
 
     public Platform getPlatform()
@@ -75,30 +64,25 @@
         return platform;
     }
 
-    public PersistenceBrokerInternal getBrokerForClass()
-    {
-        return brokerForClass;
-    }
-
     public Properties getConfigurationProperties()
     {
-        return this.configurationProperties;
+        return this.sd.getAttributes();
     }
 
     public void setConfigurationProperties(Properties prop)
     {
-        this.configurationProperties.putAll(prop);
+        this.sd.addAttributes(prop);
     }
 
     public String getConfigurationProperty(String key, String defaultValue)
     {
-        String result = this.configurationProperties.getProperty(key);
+        String result = this.sd.getAttribute(key);
         return result != null ? result : defaultValue;
     }
 
     public void setConfigurationProperty(String key, String value)
     {
-        this.configurationProperties.setProperty(key, value);
+        this.sd.addAttribute(key, value);
     }
 
     public boolean useAutoNaming()
@@ -106,7 +90,7 @@
         return BooleanUtils.toBoolean(getConfigurationProperty(PROPERTY_AUTO_NAMING, "true"));
     }
 
-    public String calculateSequenceName(FieldDescriptor field) throws SequenceManagerException
+    public String calculateSequenceName(final FieldDescriptor field) throws SequenceManagerException
     {
         String seqName;
         seqName = field.getSequenceName();
@@ -116,7 +100,7 @@
         */
         if(seqName == null)
         {
-            seqName = SequenceManagerHelper.buildSequenceName(getBrokerForClass(), field, useAutoNaming());
+            seqName = SequenceManagerHelper.buildSequenceName(field, useAutoNaming());
             // already done in method above
             // if(useAutoNaming()) field.setSequenceName(seqName);
         }
@@ -134,9 +118,9 @@
      * The returned object is unique accross all tables in the extent
      * of class the field belongs to.
      */
-    public Object getUniqueValue(FieldDescriptor field) throws SequenceManagerException
+    public Object getUniqueValue(final PersistenceBrokerInternal broker, final FieldDescriptor field) throws SequenceManagerException
     {
-        Object result = field.getJdbcType().sequenceKeyConversion(new Long(getUniqueLong(field)));
+        Object result = field.getJdbcType().sequenceKeyConversion(new Long(getUniqueLong(broker, field)));
         // perform a sql to java conversion here, so that clients do
         // not see any db specific values
         result = field.getFieldConversion().sqlToJava(result);
@@ -146,7 +130,7 @@
     /**
      * noop
      */
-    public void afterStore(JdbcAccess dbAccess, ClassDescriptor cld, Object obj)
+    public void afterStore(final PersistenceBrokerInternal broker, final JdbcAccess dbAccess, final ClassDescriptor cld, Object obj)
             throws SequenceManagerException
     {
         // do nothing

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/HighLowSequence.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/HighLowSequence.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/HighLowSequence.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/HighLowSequence.java Fri Jan 12 10:19:39 2007
@@ -31,7 +31,6 @@
 	static final long serialVersionUID = -2174468157880921393L;
     private String name;
     private long maxKey;
-    private int grabSize;
     private Integer version;
      // This is not stored in the DB
     protected long curVal = 0;
@@ -43,20 +42,19 @@
     {
         // make sure that version column in DB is never 'null'
         // to avoid problems with
-        this(null, 0, 0, new Integer(0));
+        this(null, 0, new Integer(0));
     }
 
-    public HighLowSequence(String tableName, long maxKey, int grabSize, Integer version)
+    public HighLowSequence(String tableName, long maxKey, Integer version)
     {
         this.name = tableName;
         this.maxKey = maxKey;
-        this.grabSize = grabSize;
         this.version = version;
     }
 
     public HighLowSequence getCopy()
     {
-        HighLowSequence result = new HighLowSequence(this.name, this.maxKey, this.grabSize, this.version);
+        HighLowSequence result = new HighLowSequence(this.name, this.maxKey, this.version);
         result.curVal = this.curVal;
         return result;
     }
@@ -65,7 +63,6 @@
     {
         ToStringBuilder buf = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
         buf.append("name", name).
-                append("grabSize", grabSize).
                 append("version", version).
                 append("maxKey", maxKey).
                 append("currentKey", curVal);
@@ -93,16 +90,6 @@
     }
 
     /**
-     * Sets the grab size attribute of the HighLowSequence object
-     *
-     * @param grabSize  The new grabSize value
-     */
-    public void setGrabSize(int grabSize)
-    {
-        this.grabSize = grabSize;
-    }
-
-    /**
      * Sets the maxKey attribute of the HighLowSequence object
      *
      * @param maxKey  The new maxKey value
@@ -123,16 +110,6 @@
     }
 
     /**
-     * Gets the grabSize attribute of the HighLowSequence object
-     *
-     * @return   The grabSize value
-     */
-    public int getGrabSize()
-    {
-        return this.grabSize;
-    }
-
-    /**
      * Gets the next key from this sequence
      *
      * @return   The next key or 0 if sequence needs to grab new keyset
@@ -164,7 +141,7 @@
     /**
      * Grabs the next key set, the sequence must be saved afterwards!!
      */
-    public void grabNextKeySet()
+    public void grabNextKeySet(int grabSize)
     {
         curVal = maxKey;
         maxKey = maxKey + grabSize;

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManager.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManager.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManager.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManager.java Fri Jan 12 10:19:39 2007
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 
+import org.apache.ojb.broker.PersistenceBrokerInternal;
 import org.apache.ojb.broker.accesslayer.JdbcAccess;
 import org.apache.ojb.broker.metadata.ClassDescriptor;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
@@ -25,7 +26,8 @@
  * There are some standard sequence manager implementations in
  * this package.
  * <p/>
- * SequenceManager objects are obtained from the component container.
+ * <code>SequenceManager</code> objects are obtained from the component container
+ * or (if per field declaration is enabled) from the field.
  * This Factory can be configured to provide instances of user defined
  * implementors of this interface.
  * <p/>
@@ -50,17 +52,26 @@
      * <br/>
      * Implementations using native identity columns should return a unique
      * incremented counter object for temporary use by OJB.
+     *
+     * @param broker The current broker instance.
+     * @param field The field to autoincrement.
+     * @return The generated sequence key.
+     * @throws SequenceManagerException
      */
-    public Object getUniqueValue(FieldDescriptor field) throws SequenceManagerException;
+    public Object getUniqueValue(PersistenceBrokerInternal broker, FieldDescriptor field)
+            throws SequenceManagerException;
 
     /**
      * This method is called <strong>after</strong> the object was written to the persistent storage.
      * <br/>
      * This is to support native Identity columns (auto_increment columns) on the db side.
      * Other implementations may ignore this method.
+     *
+     * @param broker The current broker instance.
      * @param dbAccess Current used {@link org.apache.ojb.broker.accesslayer.JdbcAccess} instance
      * @param cld Descriptor for specified object
      * @param obj The object to associate with identity value
      */
-    public void afterStore(JdbcAccess dbAccess, ClassDescriptor cld, Object obj) throws SequenceManagerException;
+    public void afterStore(PersistenceBrokerInternal broker, JdbcAccess dbAccess, ClassDescriptor cld, Object obj)
+            throws SequenceManagerException;
 }

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerException.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerException.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerException.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerException.java Fri Jan 12 10:19:39 2007
@@ -21,7 +21,6 @@
  * An exception thrown by {@link org.apache.ojb.broker.util.sequence.SequenceManager}
  * implementations.
  *
- * @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
  * @version $Id$
  */
 public class SequenceManagerException extends OJBException

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHelper.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHelper.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHelper.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHelper.java Fri Jan 12 10:19:39 2007
@@ -17,18 +17,20 @@
 
 import java.sql.ResultSet;
 import java.sql.Statement;
-import java.util.Collection;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Properties;
-import java.util.Vector;
 
+import org.apache.ojb.broker.OJBRuntimeException;
 import org.apache.ojb.broker.PersistenceBroker;
 import org.apache.ojb.broker.PersistenceBrokerException;
 import org.apache.ojb.broker.accesslayer.StatementManager;
 import org.apache.ojb.broker.metadata.ClassDescriptor;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
+import org.apache.ojb.broker.metadata.SequenceDescriptor;
+import org.apache.ojb.broker.metadata.DescriptorRepository;
 import org.apache.ojb.broker.platforms.Platform;
 import org.apache.ojb.broker.query.Query;
+import org.apache.ojb.broker.util.ClassHelper;
 import org.apache.ojb.broker.util.logging.Logger;
 import org.apache.ojb.broker.util.logging.LoggerFactory;
 
@@ -100,13 +102,12 @@
      * using {@link org.apache.ojb.broker.metadata.FieldDescriptor#setSequenceName}
      * to speed up sequence name lookup in future calls.
      * </p>
-     * @param brokerForClass current used PB instance
+     *
      * @param field target field
      * @param autoNaming if 'false' no auto sequence name was build and
      * a exception was throw if none could be found in field.
      */
-    public static String buildSequenceName(PersistenceBroker brokerForClass,
-                                           FieldDescriptor field, boolean autoNaming)
+    public static String buildSequenceName(FieldDescriptor field, boolean autoNaming)
             throws SequenceManagerException
     {
         String seqName = field.getSequenceName();
@@ -114,32 +115,28 @@
         if we found a sequence name bound to the field descriptor
         via 'sequence-name' attribute we use that name
         */
-        if (seqName == null || seqName.trim().length() == 0)
+        if(seqName == null || seqName.trim().length() == 0)
         {
             if(autoNaming)
             {
-                ClassDescriptor cldTargetClass = field.getClassDescriptor();
-                /*
-                check for inheritance on multiple table
-                */
-                cldTargetClass = findInheritanceRoot(cldTargetClass);
-                Class topLevel = brokerForClass.getTopLevelClass(cldTargetClass.getClassOfObject());
-                ClassDescriptor cldTopLevel = brokerForClass.getClassDescriptor(topLevel);
                 /**
-                 *
                  * MBAIRD
-                 * Should not use classname for the sequenceName as we will end up
-                 * re-using sequence numbers for classes mapped to the same table.
-                 * Instead, make the FullTableName the discriminator since it will
+                 * Should not use classname for the sequence name as we will end up re-using sequence numbers for
+                 * classes mapped to the same table. Instead, make the FullTableName the discriminator since it will
                  * always be unique for that table, and hence that class.
                  *
                  * arminw:
-                 * If the found top-level class has extents, we take the first
-                 * found extent class table name as sequence name. Else we take
-                 * the table name of the 'targetClass'.
-                 *
+                 * If the found top-level class has extents, we take the first found extent class table name as
+                 * sequence name. Else we take the table name of the 'targetClass'.
                  */
-                if (cldTopLevel.isExtent())
+                ClassDescriptor cldTargetClass = field.getClassDescriptor();
+                DescriptorRepository model = cldTargetClass.getRepository();
+                /*
+                check for table-per-subclass inheritance
+                */
+                cldTargetClass = findInheritanceRoot(cldTargetClass);
+                cldTargetClass = cldTargetClass.getTopLevelClassDescriptor();
+                if(!cldTargetClass.isMappedToTable())
                 {
                     /*
                     arminw:
@@ -150,16 +147,11 @@
                     sequence manager docs
                     TODO: find better solution
                     */
-        //            seqName = brokerForClass.getClassDescriptor(((Class) cldTopLevel.getExtentClasses().
-        //                    get(0))).getFullTableName();
-                    seqName = firstFoundTableName(brokerForClass, cldTopLevel);
+                    cldTargetClass = cldTargetClass.getRepository().findFirstConcreteClass(cldTargetClass);
                 }
-                else
-                {
-                    seqName = cldTargetClass.getFullTableName();
-                }
-        //        log.info("* targetClass: "+targetClass +", toplevel: "+topLevel+ " seqName: "+seqName);
-                if (seqName == null)
+                seqName = cldTargetClass.getFullTableName();
+                //        log.info("* targetClass: "+targetClass +", toplevel: "+topLevel+ " seqName: "+seqName);
+                if(seqName == null)
                 {
                     seqName = SEQ_UNASSIGNED;
                     log.warn("Too complex structure, can not assign automatic sequence name for field '" +
@@ -167,14 +159,14 @@
                             field.getClassDescriptor().getClassNameOfObject() +
                             "'. Use a default sequence name instead: " + (SEQ_PREFIX + seqName));
                 }
-        //        System.out.println("* targetClass: " + cldTargetClass.getClassNameOfObject() + ", toplevel: " + topLevel + " seqName: " + seqName);
+                //        System.out.println("* targetClass: " + cldTargetClass.getClassNameOfObject() + ", toplevel: " + topLevel + " seqName: " + seqName);
                 seqName = SEQ_PREFIX + seqName;
-                if (log.isDebugEnabled())
+                if(log.isDebugEnabled())
                 {
-                        log.debug("Set automatic generated sequence-name for field '" +
-                                field.getAttributeName() + "' in class '" +
-                                field.getClassDescriptor().getClassNameOfObject() +
-                                "'.");
+                    log.debug("Set automatic generated sequence-name for field '" +
+                            field.getAttributeName() + "' in class '" +
+                            field.getClassDescriptor().getClassNameOfObject() +
+                            "'.");
                 }
                 field.setSequenceName(seqName);
             }
@@ -211,48 +203,24 @@
     }
 
     /**
-     * try to find the first none null table name for the given class-descriptor.
-     * If cld has extent classes, all of these cld's searched for the first none null
-     * table name.
-     */
-    private static String firstFoundTableName(PersistenceBroker brokerForClass, ClassDescriptor cld)
-    {
-        String name = null;
-        if (cld.isMappedToTable() && cld.getFullTableName() != null)
-        {
-            return cld.getFullTableName();
-        }
-        if (cld.isExtent())
-        {
-            Collection extentClasses = cld.getExtentClasses();
-            for (Iterator iterator = extentClasses.iterator(); iterator.hasNext();)
-            {
-                name = firstFoundTableName(brokerForClass, brokerForClass.getClassDescriptor((Class) iterator.next()));
-                // System.out.println("## " + cld.getClassNameOfObject()+" - name: "+name);
-                if (name != null) break;
-            }
-        }
-        return name;
-    }
-
-    /**
      * Lookup all tables associated with given class (search all extent classes)
      * to find the current maximum value for the given field.
      * <br><b>Note:</b> Only works for <code>long</code> autoincrement fields.
+     *
      * @param brokerForClass persistence broker instance match the database of the
      * given field/class
      * @param field the target field
      */
     public static long getMaxForExtent(PersistenceBroker brokerForClass, FieldDescriptor field) throws PersistenceBrokerException
     {
-        if (field == null)
+        if(field == null)
         {
             log.error("Given FieldDescriptor was null, could not detect max value across all extents");
             return 0;
             // throw new PersistenceBrokerException("Given FieldDescriptor was null");
         }
         // first lookup top-level class
-        Class topLevel = brokerForClass.getTopLevelClass(field.getClassDescriptor().getClassOfObject());
+        Class topLevel = field.getClassDescriptor().getTopLevelClass();
         return getMaxId(brokerForClass, topLevel, field);
     }
 
@@ -267,22 +235,22 @@
         ClassDescriptor cld = brokerForClass.getClassDescriptor(topLevel);
 
         // if class is mapped / not abstract we have to search its directly mapped table
-        if (cld.isMappedToTable() && !cld.isAbstract())
+        if(cld.isMappedToTable())
         {
             tmp = getMaxIdForClass(brokerForClass, cld, original);
-            if (tmp > max)
+            if(tmp > max)
             {
                 max = tmp;
             }
         }
         // if class is an extent we have to search through its subclasses
-        if (cld.isExtent())
+        if(cld.isExtent())
         {
-            Vector extentClasses = cld.getExtentClasses();
-            for (int i = 0; i < extentClasses.size(); i++)
+            List extentClasses = cld.getExtentClasses();
+            for(int i = 0; i < extentClasses.size(); i++)
             {
                 Class extentClass = (Class) extentClasses.get(i);
-                if (cld.getClassOfObject().equals(extentClass))
+                if(cld.getClassOfObject().equals(extentClass))
                 {
                     throw new PersistenceBrokerException("Circular extent in " + extentClass +
                             ", please check the repository");
@@ -293,7 +261,7 @@
                     // Call recursive
                     tmp = getMaxId(brokerForClass, extentClass, original);
                 }
-                if (tmp > max)
+                if(tmp > max)
                 {
                     max = tmp;
                 }
@@ -311,10 +279,10 @@
             throws PersistenceBrokerException
     {
         FieldDescriptor field = null;
-        if (!original.getClassDescriptor().equals(cldForOriginalOrExtent))
+        if(!original.getClassDescriptor().equals(cldForOriginalOrExtent))
         {
             // check if extent match not the same table
-            if (!original.getClassDescriptor().getFullTableName().equals(
+            if(!original.getClassDescriptor().getFullTableName().equals(
                     cldForOriginalOrExtent.getFullTableName()))
             {
                 // we have to look for id's in extent class table
@@ -325,7 +293,7 @@
         {
             field = original;
         }
-        if (field == null)
+        if(field == null)
         {
             // if null skip this call
             return 0;
@@ -347,7 +315,7 @@
             rs.next();
             result = rs.getLong(1);
         }
-        catch (Exception e)
+        catch(Exception e)
         {
             log.warn("Cannot lookup max value from table " + table + " for column " + column +
                     ", PB was " + brokerForClass + ", using jdbc-descriptor " +
@@ -359,10 +327,10 @@
             {
                 sm.closeResources(stmt, rs);
             }
-            catch (Exception ignore)
+            catch(Exception ignore)
             {
                 // ignore it
-           }
+            }
         }
         return result;
     }
@@ -525,5 +493,28 @@
     public static String getSeqAsValue(Properties prop)
     {
         return prop.getProperty(PROP_SEQ_AS, null);
+    }
+
+    /**
+     * Create a new {@link SequenceManager} instance.
+     *
+     * @param platform The current {@link org.apache.ojb.broker.platforms.Platform}.
+     * @param descriptor The {@link org.apache.ojb.broker.metadata.SequenceDescriptor}.
+     * @return The new instance.
+     */
+    public static SequenceManager createManager(Platform platform, SequenceDescriptor descriptor)
+    {
+        try
+        {
+            return (SequenceManager) ClassHelper.newInstance(
+                    descriptor.getSequenceManagerClass(),
+                    new Class[]{Platform.class, SequenceDescriptor.class},
+                    new Object[]{platform, descriptor});
+        }
+        catch(Exception e)
+        {
+            log.error("Can't instantiate sequence manager", e);
+            throw new OJBRuntimeException("Can't instantiate sequence manager", e);
+        }
     }
 }

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java Fri Jan 12 10:19:39 2007
@@ -22,11 +22,12 @@
 import org.apache.ojb.broker.Identity;
 import org.apache.ojb.broker.OptimisticLockException;
 import org.apache.ojb.broker.PersistenceBrokerInternal;
-import org.apache.ojb.broker.OJB;
+import org.apache.ojb.broker.platforms.Platform;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
+import org.apache.ojb.broker.metadata.SequenceDescriptor;
+import org.apache.ojb.broker.util.ObjectModification;
 import org.apache.ojb.broker.util.logging.Logger;
 import org.apache.ojb.broker.util.logging.LoggerFactory;
-import org.apache.ojb.broker.util.ObjectModification;
 
 /**
  * High/Low sequence manager implementation generates unique and continuous
@@ -50,7 +51,7 @@
  *    </td>
  * </tr>
  * <tr>
- *     <td>grabSize</td>
+ *     <td>seq.grabSize</td>
  *     <td>
  *         Integer entry determines the
  *         number of IDs allocated within the
@@ -59,7 +60,7 @@
  *    </td>
  * </tr>
  * <tr>
- *     <td>autoNaming</td>
+ *     <td>seq.autoNaming</td>
  *     <td>
  *          Default was 'true'. If set 'true' OJB try to build a
  *          sequence name automatic if none found in field-descriptor
@@ -68,27 +69,6 @@
  *          if none sequence name was found in field-descriptor.
  *    </td>
  * </tr>
- * <tr>
- *     <td>globalSequenceId</td>
- *     <td>
- *         Deprecated! If set 'true' implementation use global unique
- *         id's for all fields. Default was 'false'.
- *    </td>
- * </tr>
- * <tr>
- *     <td>globalSequenceStart</td>
- *     <td>
- *         <em>Deprecated, use property 'seq.start'.</em> Set the start index of used global id
- *         generation (e.g. set 100000, id generation starts with 100001)
- *    </td>
- * </tr>
- * <tr>
- *     <td>sequenceStart</td>
- *     <td>
- *         <em>Deprecated, use property 'seq.start'.</em> Set the start index of used
- *          sequences (e.g. set 100000, id generation starts with 100001). Default start index is <em>1</em>.
- *    </td>
- * </tr>
  * </table>
  *
  * <br/>
@@ -109,7 +89,6 @@
  * @see org.apache.ojb.broker.util.sequence.SequenceManager
  * @see org.apache.ojb.broker.util.sequence.SequenceManagerHelper
  *
- * @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
  * @version $Id$
  */
 public class SequenceManagerHighLowImpl extends AbstractSequenceManager
@@ -131,9 +110,9 @@
     protected long sequenceStart;
     protected int attempts;
 
-    public SequenceManagerHighLowImpl(PersistenceBrokerInternal broker)
+    public SequenceManagerHighLowImpl(Platform platform, SequenceDescriptor descriptor)
     {
-        super(broker);
+        super(platform, descriptor);
         Long start = SequenceManagerHelper.getSeqStart(getConfigurationProperties());
         sequenceStart = start != null ? start.longValue() : 1;
         grabSize = Integer.parseInt(getConfigurationProperty(PROPERTY_GRAB_SIZE, "20"));
@@ -146,20 +125,20 @@
         }
     }
 
-    protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
+    protected long getUniqueLong(PersistenceBrokerInternal broker, FieldDescriptor field) throws SequenceManagerException
     {
         HighLowSequence seq;
-        String sequenceName = buildSequenceName(field);
+        String sequenceName = buildSequenceName(broker, field);
         synchronized(sync)
         {
             // try to find sequence
-            seq = getSequence(sequenceName);
+            seq = getSequence(broker, sequenceName);
 
             if (seq == null)
             {
                 // not found, get sequence from database or create new
-                seq = getSequence(getBrokerForClass(), field, sequenceName);
-                addSequence(sequenceName, seq);
+                seq = getSequence(broker, field, sequenceName);
+                addSequence(broker, sequenceName, seq);
             }
 
             // now we have a sequence
@@ -167,19 +146,19 @@
             // seq does not have reserved IDs => catch new block of keys
             if (id == 0)
             {
-                seq = getSequence(getBrokerForClass(), field, sequenceName);
+                seq = getSequence(broker, field, sequenceName);
                 // replace old sequence!!
-                addSequence(sequenceName, seq);
+                addSequence(broker, sequenceName, seq);
                 id = seq.getNextId();
                 if (id == 0)
                 {
                     // something going wrong
-                    removeSequence(sequenceName);
+                    removeSequence(broker, sequenceName);
                     throw new SequenceManagerException("Sequence generation failed: " +
                             SystemUtils.LINE_SEPARATOR + "Sequence: " + seq +
                             ". Unable to build new ID, id was always 0." +
                             SystemUtils.LINE_SEPARATOR + "Thread: " + Thread.currentThread() +
-                            SystemUtils.LINE_SEPARATOR + "PB: " + getBrokerForClass());
+                            SystemUtils.LINE_SEPARATOR + "PB: " + broker);
                 }
             }
             return id;
@@ -193,12 +172,11 @@
      * @param sequenceName Name of the sequence.
      * @return Sequence object or <code>null</code>
      */
-    private HighLowSequence getSequence(String sequenceName)
+    private HighLowSequence getSequence(PersistenceBrokerInternal broker, String sequenceName)
     {
         HighLowSequence result = null;
         // now lookup the sequence map for calling DB
-        Map mapForDB = (Map) sequencesMap.get(getBrokerForClass()
-                .serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
+        Map mapForDB = (Map) sequencesMap.get(broker.serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
         if(mapForDB != null)
         {
             result = (HighLowSequence) mapForDB.get(sequenceName);
@@ -211,11 +189,10 @@
      * @param sequenceName Name of the sequence.
      * @param seq The sequence object to add.
      */
-    private void addSequence(String sequenceName, HighLowSequence seq)
+    private void addSequence(PersistenceBrokerInternal broker, String sequenceName, HighLowSequence seq)
     {
         // lookup the sequence map for calling DB
-        String jcdAlias = getBrokerForClass()
-                .serviceConnectionManager().getConnectionDescriptor().getJcdAlias();
+        String jcdAlias = broker.serviceConnectionManager().getConnectionDescriptor().getJcdAlias();
         Map mapForDB = (Map) sequencesMap.get(jcdAlias);
         if(mapForDB == null)
         {
@@ -230,11 +207,10 @@
      *
      * @param sequenceName Name of the sequence to remove.
      */
-    protected void removeSequence(String sequenceName)
+    protected void removeSequence(PersistenceBrokerInternal broker, String sequenceName)
     {
         // lookup the sequence map for calling DB
-        Map mapForDB = (Map) sequencesMap.get(getBrokerForClass()
-                .serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
+        Map mapForDB = (Map) sequencesMap.get(broker.serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
         if(mapForDB != null)
         {
             synchronized(sync)
@@ -264,7 +240,7 @@
             internBroker = brokerForSequence.getConfiguration().createPersistenceBroker();
             internBroker.beginTransaction();
 
-            newSequence = lookupStoreSequence(internBroker, field, sequenceName);
+            newSequence = lookupStoreSequence(brokerForSequence, internBroker, field, sequenceName);
 
             internBroker.commitTransaction();
 
@@ -286,14 +262,16 @@
         return newSequence;
     }
 
-    protected HighLowSequence lookupStoreSequence(PersistenceBrokerInternal broker, FieldDescriptor field, String seqName)
+    protected HighLowSequence lookupStoreSequence(PersistenceBrokerInternal currentBroker,
+                                                  PersistenceBrokerInternal temporaryBroker,
+                                                  FieldDescriptor field, String seqName)
     {
         HighLowSequence newSequence;
         boolean needsInsert = false;
 
-        Identity oid = broker.serviceIdentity().buildIdentity(HighLowSequence.class, seqName);
+        Identity oid = temporaryBroker.serviceIdentity().buildIdentity(HighLowSequence.class, seqName);
         // first we lookup sequence object in database
-        newSequence = (HighLowSequence) broker.getObjectByIdentity(oid);
+        newSequence = (HighLowSequence) temporaryBroker.getObjectByIdentity(oid);
 
         //not in db --> we have to store a new sequence
         if (newSequence == null)
@@ -306,7 +284,7 @@
             here we lookup the max key for the given field in system
             */
             // !!! here we use current broker instance to avoid deadlock !!!
-            long maxKey = getMaxKeyForSequence(getBrokerForClass(), field);
+            long maxKey = getMaxKeyForSequence(currentBroker, field);
 
             newSequence = newSequenceObject(seqName, field);
             newSequence.setMaxKey(maxKey);
@@ -319,28 +297,29 @@
             newSequence.setMaxKey(sequenceStart);
         }
 
-        // set current grab size
-        newSequence.setGrabSize(grabSize);
-
         //grab the next key scope
-        newSequence.grabNextKeySet();
+        newSequence.grabNextKeySet(grabSize);
 
         //store the sequence to db
         try
         {
-            if(needsInsert) broker.store(newSequence, ObjectModification.INSERT);
-            else broker.store(newSequence, ObjectModification.UPDATE);
+            if(needsInsert) temporaryBroker.store(newSequence, ObjectModification.INSERT);
+            else temporaryBroker.store(newSequence, ObjectModification.UPDATE);
         }
         catch (OptimisticLockException e)
         {
-            // we try five times to get a new sequence
-            if(attempts < 5)
+            // we try ten times to get a new sequence
+            if(attempts < 10)
             {
                 log.info("OptimisticLockException was thrown, will try again to store sequence. Sequence was "+newSequence);
                 attempts++;
-                newSequence = lookupStoreSequence(broker, field, seqName);
+                newSequence = lookupStoreSequence(currentBroker, temporaryBroker, field, seqName);
+            }
+            else
+            {
+                log.error("Tried 10 times to store sequence object " + newSequence + " without success");
+                throw e;
             }
-            else throw e;
         }
         return newSequence;
     }
@@ -350,7 +329,6 @@
     {
         HighLowSequence seq = new HighLowSequence();
         seq.setName(sequenceName);
-        seq.setGrabSize(grabSize);
         return seq;
     }
 
@@ -374,7 +352,7 @@
         return maxKey;
     }
 
-    private String buildSequenceName(FieldDescriptor field) throws SequenceManagerException
+    private String buildSequenceName(PersistenceBrokerInternal broker, FieldDescriptor field) throws SequenceManagerException
     {
         String seqName;
         if (useGlobalSequenceIdentities)
@@ -386,5 +364,35 @@
             seqName = calculateSequenceName(field);
         }
         return seqName;
+    }
+
+    public int getGrabSize()
+    {
+        return grabSize;
+    }
+
+    public void setGrabSize(int grabSize)
+    {
+        this.grabSize = grabSize;
+    }
+
+    public long getSequenceStart()
+    {
+        return sequenceStart;
+    }
+
+    public void setSequenceStart(long sequenceStart)
+    {
+        this.sequenceStart = sequenceStart;
+    }
+
+    public boolean isUseGlobalSequenceIdentities()
+    {
+        return useGlobalSequenceIdentities;
+    }
+
+    public void setUseGlobalSequenceIdentities(boolean useGlobalSequenceIdentities)
+    {
+        this.useGlobalSequenceIdentities = useGlobalSequenceIdentities;
     }
 }

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerInMemoryImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerInMemoryImpl.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerInMemoryImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerInMemoryImpl.java Fri Jan 12 10:19:39 2007
@@ -19,7 +19,9 @@
 import java.util.Map;
 
 import org.apache.ojb.broker.PersistenceBrokerInternal;
+import org.apache.ojb.broker.platforms.Platform;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
+import org.apache.ojb.broker.metadata.SequenceDescriptor;
 
 /**
  * <p>
@@ -53,7 +55,7 @@
  *    </td>
  * </tr>
  * <tr>
- *     <td>autoNaming</td>
+ *     <td>seq.autoNaming</td>
  *     <td>
  *          Default was 'true'. If set 'true' OJB try to build a
  *          sequence name automatic if none found in field-descriptor
@@ -62,14 +64,6 @@
  *          if none sequence name was found in field-descriptor.
  *    </td>
  * </tr>
- * <tr>
- *     <td>sequenceStart</td>
- *     <td>
- *          <em>Deprecated, use property 'seq.start'.</em> Set the start index
- *          of used sequences (e.g. set 100000, id generation starts with 100001).
- *          Default start index is <em>1</em>.
- *    </td>
- * </tr>
  * </table>
  *
  * <br/>
@@ -78,9 +72,6 @@
  *
  * @see org.apache.ojb.broker.util.sequence.SequenceManager
  * @see org.apache.ojb.broker.util.sequence.SequenceManagerHelper
- *
- *
- * @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
  * @version $Id$
  */
 public class SequenceManagerInMemoryImpl extends AbstractSequenceManager
@@ -88,31 +79,31 @@
     protected static Map sequencesDBMap = new HashMap();
     private long sequenceStart;
 
-    public SequenceManagerInMemoryImpl(PersistenceBrokerInternal broker)
+    public SequenceManagerInMemoryImpl(Platform platform, SequenceDescriptor descriptor)
     {
-        super(broker);
+        super(platform, descriptor);
         Long start = SequenceManagerHelper.getSeqStart(getConfigurationProperties());
         sequenceStart = start != null ? start.longValue() : 1;
     }
 
-    protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
+    protected long getUniqueLong(PersistenceBrokerInternal broker, FieldDescriptor field) throws SequenceManagerException
     {
         String seqName = calculateSequenceName(field);
         // we have to be threadsafe
         synchronized (SequenceManagerInMemoryImpl.class)
         {
             // get id for given seq name
-            Long currentId = getSequence(seqName);
+            Long currentId = getSequence(broker, seqName);
             // check - first time we search for sequence name
             if (currentId == null)
             {
-                long maxKey = SequenceManagerHelper.getMaxForExtent(getBrokerForClass(), field);
+                long maxKey = SequenceManagerHelper.getMaxForExtent(broker, field);
                 maxKey = sequenceStart > maxKey ? sequenceStart : maxKey;
                 currentId = new Long(maxKey);
             }
             currentId = new Long(currentId.longValue() + 1);
             // put new id back to map
-            addSequence(seqName, currentId);
+            addSequence(broker, seqName, currentId);
             return currentId.intValue();
         }
     }
@@ -124,12 +115,12 @@
      * @param sequenceName Name of the sequence.
      * @return Last used sequence value or <code>null</code>
      */
-    private Long getSequence(String sequenceName)
+    private Long getSequence(PersistenceBrokerInternal broker, String sequenceName)
     {
         Long result = null;
         // now lookup the sequence map for calling DB
-        Map mapForDB = (Map) sequencesDBMap.get(getBrokerForClass()
-                .serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
+        Map mapForDB = (Map) sequencesDBMap.get(broker.serviceConnectionManager()
+                .getConnectionDescriptor().getJcdAlias());
         if(mapForDB != null)
         {
             result = (Long) mapForDB.get(sequenceName);
@@ -142,11 +133,10 @@
      * @param sequenceName Name of the sequence.
      * @param seq The sequence value to add.
      */
-    private void addSequence(String sequenceName, Long seq)
+    private void addSequence(PersistenceBrokerInternal broker, String sequenceName, Long seq)
     {
         // lookup the sequence map for calling DB
-        String jcdAlias = getBrokerForClass()
-                .serviceConnectionManager().getConnectionDescriptor().getJcdAlias();
+        String jcdAlias = broker.serviceConnectionManager().getConnectionDescriptor().getJcdAlias();
         Map mapForDB = (Map) sequencesDBMap.get(jcdAlias);
         if(mapForDB == null)
         {
@@ -161,11 +151,10 @@
      *
      * @param sequenceName Name of the sequence to remove.
      */
-    protected void removeSequence(String sequenceName)
+    protected void removeSequence(PersistenceBrokerInternal broker, String sequenceName)
     {
         // lookup the sequence map for calling DB
-        Map mapForDB = (Map) sequencesDBMap.get(getBrokerForClass()
-                .serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
+        Map mapForDB = (Map) sequencesDBMap.get(broker.serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
         if(mapForDB != null)
         {
             synchronized(SequenceManagerInMemoryImpl.class)
@@ -173,5 +162,15 @@
                 mapForDB.remove(sequenceName);
             }
         }
+    }
+
+    public long getSequenceStart()
+    {
+        return sequenceStart;
+    }
+
+    public void setSequenceStart(long sequenceStart)
+    {
+        this.sequenceStart = sequenceStart;
     }
 }

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerMSSQLGuidImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerMSSQLGuidImpl.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerMSSQLGuidImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerMSSQLGuidImpl.java Fri Jan 12 10:19:39 2007
@@ -20,10 +20,12 @@
 import org.apache.commons.lang.SystemUtils;
 import org.apache.ojb.broker.PersistenceBrokerException;
 import org.apache.ojb.broker.PersistenceBrokerInternal;
+import org.apache.ojb.broker.platforms.Platform;
 import org.apache.ojb.broker.accesslayer.ResultSetAndStatement;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
 import org.apache.ojb.broker.metadata.JdbcType;
 import org.apache.ojb.broker.metadata.JdbcTypesHelper;
+import org.apache.ojb.broker.metadata.SequenceDescriptor;
 import org.apache.ojb.broker.query.Query;
 import org.apache.ojb.broker.util.logging.LoggerFactory;
 
@@ -37,7 +39,6 @@
  * This SequenceManager can be used for any classes that have their PK
  * defined as a 'uniqueidetifier'
  *
- * @author <a href="mailto:aclute825@hotmail.com">Andrew Clute</a>
  * @version $Id$
  */
 public class SequenceManagerMSSQLGuidImpl extends AbstractSequenceManager
@@ -45,16 +46,13 @@
     private static final JdbcType JDBC_TYPE_VARCHAR = JdbcTypesHelper.getJdbcTypeByName("varchar");
     /**
      * Constructor used by OJB.
-     *
-     * @param broker  PB instance to perform the
-     * id generation.
      */
-    public SequenceManagerMSSQLGuidImpl(PersistenceBrokerInternal broker)
+    public SequenceManagerMSSQLGuidImpl(Platform platform, SequenceDescriptor descriptor)
     {
-        super(broker);
+        super(platform, descriptor);
     }
 
-    public Object getUniqueValue(FieldDescriptor field) throws SequenceManagerException
+    public Object getUniqueValue(PersistenceBrokerInternal broker, FieldDescriptor field) throws SequenceManagerException
     {
         // only works for VARCHAR fields
         if(!field.getJdbcType().equals(JDBC_TYPE_VARCHAR))
@@ -62,7 +60,7 @@
             throw new SequenceManagerException("This implementation only works with fields defined" +
                     " as VARCHAR, but given field was " + field.getJdbcType());
         }
-        Object result = getUniqueString(field);
+        Object result = getUniqueString(broker, field);
         // perform a sql to java conversion here, so that clients do
         // not see any db specific values
         result = field.getFieldConversion().sqlToJava(result);
@@ -73,14 +71,13 @@
      * returns a unique String for given field.
      * the returned uid is unique accross all tables.
      */
-    protected String getUniqueString(FieldDescriptor field) throws SequenceManagerException
+    protected String getUniqueString(PersistenceBrokerInternal broker, FieldDescriptor field) throws SequenceManagerException
     {
         ResultSetAndStatement rsStmt = null;
         String returnValue = null;
         try
         {
-            rsStmt = getBrokerForClass().serviceJdbcAccess().executeSQL(
-                    "select newid()", Query.NOT_SCROLLABLE);
+            rsStmt = broker.serviceJdbcAccess().executeSQL("select newid()", Query.NOT_SCROLLABLE);
             if (rsStmt.m_rs.next())
             {
                 returnValue = rsStmt.m_rs.getString(1);
@@ -111,17 +108,7 @@
     /**
      * Returns a new unique int for the given Class and fieldname.
      */
-    protected int getUniqueId(FieldDescriptor field) throws SequenceManagerException
-    {
-        throw new SequenceManagerException(
-                SystemUtils.LINE_SEPARATOR +
-                "Failure attempting to retrieve a Guid for a field that is an int -- field should be returned as a VARCHAR");
-    }
-
-    /**
-     * Returns a new unique int for the given Class and fieldname.
-     */
-    protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
+    protected long getUniqueLong(PersistenceBrokerInternal broker, FieldDescriptor field) throws SequenceManagerException
     {
         throw new SequenceManagerException(
                 SystemUtils.LINE_SEPARATOR +

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNativeImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNativeImpl.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNativeImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNativeImpl.java Fri Jan 12 10:19:39 2007
@@ -22,9 +22,11 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ojb.broker.PersistenceBrokerInternal;
+import org.apache.ojb.broker.platforms.Platform;
 import org.apache.ojb.broker.accesslayer.JdbcAccess;
 import org.apache.ojb.broker.metadata.ClassDescriptor;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
+import org.apache.ojb.broker.metadata.SequenceDescriptor;
 import org.apache.ojb.broker.metadata.fieldaccess.PersistentField;
 
 
@@ -75,149 +77,13 @@
  * <br/>
  * <br/>
  *
- * @author <a href="mailto:travis@spaceprogram.com">Travis Reeder</a>
- * @author <a href="mailto:arminw@apache.org">Armin Waibel</a>
+ * @deprecated use {@link SequenceManagerIdentityImpl} instead.
  * @version $Id$
  */
-public class SequenceManagerNativeImpl extends AbstractSequenceManager
+public class SequenceManagerNativeImpl extends SequenceManagerIdentityImpl
 {
-    private Log log = LogFactory.getLog(SequenceManagerNativeImpl.class);
-
-    /*
-     TODO:
-     1. Find a better solution (if possible) for this problem
-     We need this dummy field to return a negative long value
-     on getUniqueLong(...) call. If we return always the same
-     value, the resulting Identity object was found on cache.
-
-     2. Problem is that generated oid (by Identity column)
-     must not begin with 0.
-
-     Use keyword 'volatile' to make decrement of a long value an
-     atomic operation
-     */
-    private static volatile long tempKey = -1;
-
-    public SequenceManagerNativeImpl(PersistenceBrokerInternal broker)
-    {
-        super(broker);
-    }
-
-    public void afterStore(JdbcAccess dbAccess, ClassDescriptor cld, Object obj) throws SequenceManagerException
-    {
-        FieldDescriptor identityField = extractIdentityColumnField(cld);
-        if(identityField != null)
-        {
-            ifNotReadOnlyFail(identityField);
-            long newId = getLastInsert(cld, identityField);
-            setFieldValue(obj, identityField, new Long(newId));
-        }
-    }
-
-    /**
-     * Gets the identity column descriptor for the given class
-     * or return <code>null</code> if none defined.
-     *
-     * @param cld The class descriptor
-     * @return The class's identity column or <code>null</code> if it does not have one
-     */
-    private FieldDescriptor extractIdentityColumnField(ClassDescriptor cld)
-    {
-        FieldDescriptor[] pkFields = cld.getPkFields();
-        for(int i = 0; i < pkFields.length; i++)
-        {
-            // to find the identity column we search for a autoincrement
-            // read-only field
-            if(pkFields[i].isAutoIncrement() && pkFields[i].isAccessReadOnly())
-            {
-                return pkFields[i];
-            }
-        }
-        return null;
-    }
-
-    private void ifNotReadOnlyFail(FieldDescriptor field) throws SequenceManagerException
-    {
-        // is field declared as read-only?
-        if(!field.isAccessReadOnly())
-        {
-            throw new SequenceManagerException("Can't find Identity column: Identity columns/fields need to be declared as" +
-                    " 'autoincrement' with 'readonly' access in field-descriptor");
-        }
-    }
-
-    private long getLastInsert(ClassDescriptor cld, FieldDescriptor field) throws SequenceManagerException
-    {
-        long newId = 0;
-        Statement stmt = null;
-        if(field != null)
-        { // an autoinc column exists
-            try
-            {
-                stmt = getBrokerForClass().serviceConnectionManager().getConnection().createStatement();
-                ResultSet rs = stmt.executeQuery(lastInsertSelect(cld.getFullTableName()));
-                if(!rs.next())
-                {
-                    throw new SequenceManagerException("Could not find native identifier");
-                }
-                newId = rs.getLong(1);
-                rs.close();
-                if(log.isDebugEnabled()) log.debug("After store - newid=" + newId);
-            }
-            catch(Exception e)
-            {
-                throw new SequenceManagerException(
-                        "Error while execute query: " + lastInsertSelect(cld.getFullTableName()), e);
-            }
-            finally
-            {
-                try
-                {
-                    if(stmt != null) stmt.close();
-                }
-                catch(SQLException e)
-                {
-                    if(log.isDebugEnabled())
-                        log.debug("Threw SQLException while in getLastInsert and closing stmt", e);
-                    // ignore it
-                }
-            }
-        }
-        else
-        {
-            throw new SequenceManagerException("No autoincrement field declared, please check repository for " + cld);
-        }
-        return newId;
-    }
-
-    /*
-     * query for the last insert id.
-     */
-    protected String lastInsertSelect(String tableName)
-    {
-        return getBrokerForClass().serviceConnectionManager().
-                getSupportedPlatform().getLastInsertIdentityQuery(tableName);
-    }
-
-    private void setFieldValue(Object obj, FieldDescriptor field, Long identifier) throws SequenceManagerException
-    {
-        Object result = field.getJdbcType().sequenceKeyConversion(identifier);
-        result = field.getFieldConversion().sqlToJava(result);
-        PersistentField pf = field.getPersistentField();
-        pf.set(obj, result);
-    }
-
-    /**
-     * returns a negative value
-     */
-    protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
+    public SequenceManagerNativeImpl(Platform platform, SequenceDescriptor descriptor)
     {
-        /*
-        arminw:
-        workaround for locking problems of new objects
-        We need unique 'dummy keys' for new objects before storing.
-        Variable 'tempKey' is declared volatile, thus decrement should be atomic
-        */
-        return --tempKey;
+        super(platform, descriptor);
     }
 }

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNextValImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNextValImpl.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNextValImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNextValImpl.java Fri Jan 12 10:19:39 2007
@@ -21,9 +21,11 @@
 
 import org.apache.commons.lang.SystemUtils;
 import org.apache.ojb.broker.PersistenceBrokerInternal;
+import org.apache.ojb.broker.platforms.Platform;
 import org.apache.ojb.broker.accesslayer.StatementManager;
 import org.apache.ojb.broker.metadata.ClassDescriptor;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
+import org.apache.ojb.broker.metadata.SequenceDescriptor;
 import org.apache.ojb.broker.query.Query;
 import org.apache.ojb.broker.util.logging.Logger;
 import org.apache.ojb.broker.util.logging.LoggerFactory;
@@ -57,7 +59,7 @@
  *     <td><strong>Property Values</strong></td>
  * </tr>
  * <tr>
- *     <td>autoNaming</td>
+ *     <td>seq.autoNaming</td>
  *     <td>
  *          Default was 'true'. If set 'true' OJB try to build a
  *          sequence name automatic if none found in field-descriptor
@@ -90,33 +92,23 @@
     /**
      *
      */
-    public SequenceManagerNextValImpl(PersistenceBrokerInternal broker)
+    public SequenceManagerNextValImpl(Platform platform, SequenceDescriptor descriptor)
     {
-        super(broker);
+        super(platform, descriptor);
     }
 
     /**
-     * returns a unique int value for class clazz and field fieldName.
-     * the returned number is unique accross all tables in the extent of clazz.
-     */
-    protected int getUniqueId(FieldDescriptor field) throws SequenceManagerException
-    {
-    	return (int) getUniqueLong(field);
-    }
-
-
-    /**
      * returns a unique long value for class clazz and field fieldName.
      * the returned number is unique accross all tables in the extent of clazz.
      */
-    protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
+    protected long getUniqueLong(PersistenceBrokerInternal broker, FieldDescriptor field) throws SequenceManagerException
     {
         long result;
         // lookup sequence name
         String sequenceName = calculateSequenceName(field);
         try
         {
-            result = buildNextSequence(field.getClassDescriptor(), sequenceName);
+            result = buildNextSequence(broker, field.getClassDescriptor(), sequenceName);
         }
         catch (Throwable e)
         {
@@ -124,7 +116,7 @@
             try
             {
                 log.info("Create DB sequence key '"+sequenceName+"'");
-                createSequence(field.getClassDescriptor(), sequenceName);
+                createSequence(broker, field.getClassDescriptor(), sequenceName);
             }
             catch (Exception e1)
             {
@@ -138,7 +130,7 @@
             }
             try
             {
-                result = buildNextSequence(field.getClassDescriptor(), sequenceName);
+                result = buildNextSequence(broker, field.getClassDescriptor(), sequenceName);
             }
             catch (Throwable e1)
             {
@@ -148,15 +140,17 @@
         return result;
     }
 
-    protected long buildNextSequence(ClassDescriptor cld, String sequenceName) throws Exception
+    protected long buildNextSequence(PersistenceBrokerInternal broker, ClassDescriptor cld, String sequenceName)
+            throws Exception
     {
         ResultSet rs = null;
         PreparedStatement stmt = null;
         long result = -1;
-        StatementManager stmtMan = getBrokerForClass().serviceStatementManager();
+        StatementManager stmtMan = broker.serviceStatementManager();
         try
         {
-            stmt = stmtMan.getPreparedStatement(getPlatform().nextSequenceQuery(sequenceName) ,Query.NOT_SCROLLABLE, 1, false);
+            stmt = stmtMan.getPreparedStatement(getPlatform().nextSequenceQuery(sequenceName),
+                    Query.NOT_SCROLLABLE, 1, false);
             rs = stmt.executeQuery();
             rs.next();
             result = rs.getLong(1);
@@ -168,10 +162,10 @@
         return result;
     }
 
-    protected void createSequence(ClassDescriptor cld, String sequenceName) throws Exception
+    protected void createSequence(PersistenceBrokerInternal broker, ClassDescriptor cld, String sequenceName) throws Exception
     {
         Statement stmt = null;
-        StatementManager stmtMan = getBrokerForClass().serviceStatementManager();
+        StatementManager stmtMan = broker.serviceStatementManager();
 // arminw: never try to remove existing sequences, because this may lead in unexpected behaviour
 // if the reason for the create call isn't a missing sequence (e.g. network problems)  
 //        try

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerSeqHiLoImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerSeqHiLoImpl.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerSeqHiLoImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerSeqHiLoImpl.java Fri Jan 12 10:19:39 2007
@@ -18,7 +18,9 @@
 import java.util.HashMap;
 
 import org.apache.ojb.broker.PersistenceBrokerInternal;
+import org.apache.ojb.broker.platforms.Platform;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
+import org.apache.ojb.broker.metadata.SequenceDescriptor;
 
 /**
  * <p>
@@ -76,13 +78,13 @@
 
     protected int grabSize;
 
-    public SequenceManagerSeqHiLoImpl(PersistenceBrokerInternal broker)
+    public SequenceManagerSeqHiLoImpl(Platform platform, SequenceDescriptor descriptor)
     {
-        super(broker);
+        super(platform, descriptor);
         grabSize = Integer.parseInt(getConfigurationProperty(PROPERTY_GRAB_SIZE, "20"));
     }
 
-    protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
+    protected long getUniqueLong(PersistenceBrokerInternal broker, FieldDescriptor field) throws SequenceManagerException
     {
         String sequenceName = calculateSequenceName(field);
         // we have to be threadsafe
@@ -96,11 +98,21 @@
             }
             if (entry.needNewSequence())
             {
-                entry.maxVal = grabSize * (super.getUniqueLong(field) + 1);
+                entry.maxVal = grabSize * (super.getUniqueLong(broker, field) + 1);
                 entry.counter = 0;
             }
             return entry.nextVal();
         }
+    }
+
+    public int getGrabSize()
+    {
+        return grabSize;
+    }
+
+    public void setGrabSize(int grabSize)
+    {
+        this.grabSize = grabSize;
     }
 
     class HiLoEntry

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerStoredProcedureImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerStoredProcedureImpl.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerStoredProcedureImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerStoredProcedureImpl.java Fri Jan 12 10:19:39 2007
@@ -25,7 +25,9 @@
 import org.apache.ojb.broker.PersistenceBrokerInternal;
 import org.apache.ojb.broker.accesslayer.LookupException;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
+import org.apache.ojb.broker.metadata.SequenceDescriptor;
 import org.apache.ojb.broker.platforms.PlatformException;
+import org.apache.ojb.broker.platforms.Platform;
 import org.apache.ojb.broker.query.Query;
 import org.apache.ojb.broker.util.logging.Logger;
 import org.apache.ojb.broker.util.logging.LoggerFactory;
@@ -128,12 +130,10 @@
 
     /**
      * Constructor
-     *
-     * @param broker
      */
-    public SequenceManagerStoredProcedureImpl(PersistenceBrokerInternal broker)
+    public SequenceManagerStoredProcedureImpl(Platform platform, SequenceDescriptor descriptor)
     {
-        super(broker);
+        super(platform, descriptor);
     }
 
     /**
@@ -158,7 +158,8 @@
      * @return
      * @throws SequenceManagerException
      */
-    protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
+    protected long getUniqueLong(PersistenceBrokerInternal broker, FieldDescriptor field)
+            throws SequenceManagerException
     {
         boolean needsCommit = false;
         long result = 0;
@@ -167,10 +168,9 @@
         use the associated broker instance, check if broker was in tx or
         we need to commit used connection.
         */
-        PersistenceBroker targetBroker = getBrokerForClass();
-        if(!targetBroker.isInTransaction())
+        if(!broker.isInTransaction())
         {
-            targetBroker.beginTransaction();
+            broker.beginTransaction();
             needsCommit = true;
         }
         try
@@ -179,7 +179,7 @@
             String sequenceName = calculateSequenceName(field);
             try
             {
-                result = buildNextSequence(targetBroker, sequenceName);
+                result = buildNextSequence(broker, sequenceName);
                 /*
                 if 0 was returned we assume that the stored procedure
                 did not work properly.
@@ -197,8 +197,8 @@
                 try
                 {
                     // on create, make sure to get the max key for the table first
-                    long maxKey = SequenceManagerHelper.getMaxForExtent(targetBroker, field);
-                    createSequence(targetBroker, field, sequenceName, maxKey);
+                    long maxKey = SequenceManagerHelper.getMaxForExtent(broker, field);
+                    createSequence(broker, field, sequenceName, maxKey);
                 }
                 catch (Exception e1)
                 {
@@ -209,7 +209,7 @@
                 }
                 try
                 {
-                    result = buildNextSequence(targetBroker, sequenceName);
+                    result = buildNextSequence(broker, sequenceName);
                 }
                 catch (Exception e1)
                 {
@@ -219,9 +219,9 @@
         }
         finally
         {
-            if(targetBroker != null && needsCommit)
+            if(broker != null && needsCommit)
             {
-                targetBroker.commitTransaction();
+                broker.commitTransaction();
             }
         }
         return result;

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerTransientImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerTransientImpl.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerTransientImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerTransientImpl.java Fri Jan 12 10:19:39 2007
@@ -17,7 +17,9 @@
 
 import org.apache.ojb.broker.PersistenceBroker;
 import org.apache.ojb.broker.PersistenceBrokerInternal;
+import org.apache.ojb.broker.platforms.Platform;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
+import org.apache.ojb.broker.metadata.SequenceDescriptor;
 
 /**
  * For internal use only!
@@ -34,12 +36,13 @@
      */
     private static volatile long tempKey = -1000;
 
-    public SequenceManagerTransientImpl(PersistenceBrokerInternal broker)
+    public SequenceManagerTransientImpl(Platform platform, SequenceDescriptor descriptor)
     {
-        super(broker);
+        super(platform, descriptor);
     }
 
-    protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
+    protected long getUniqueLong(PersistenceBrokerInternal broker, FieldDescriptor field)
+            throws SequenceManagerException
     {
         /*
         arminw:

Modified: db/ojb/trunk/src/java/org/apache/ojb/odmg/ObjectEnvelope.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/odmg/ObjectEnvelope.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/odmg/ObjectEnvelope.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/odmg/ObjectEnvelope.java Fri Jan 12 10:19:39 2007
@@ -190,12 +190,6 @@
             // on reuse of this object, we have to clear the link list
             if(linkEntryList.size() > 0) linkEntryList.clear();
         }
-        else
-        {
-            myObj = null;
-            realObject = null;
-        }
-        cld = null;
     }
 
     private void performImageCleanup(Map imageMap, boolean reuse)

Modified: db/ojb/trunk/src/java/org/apache/ojb/odmg/collections/DListImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/odmg/collections/DListImpl.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/odmg/collections/DListImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/odmg/collections/DListImpl.java Fri Jan 12 10:19:39 2007
@@ -342,7 +342,7 @@
                 ClassDescriptor cld = brokerForClass.getClassDescriptor(obj.getClass());
 
                 FieldDescriptor[] pkFields = cld.getPkFields();
-                ValueContainer[] pkValues = brokerForClass.serviceBrokerHelper().getKeyValues(cld, obj);
+                ValueContainer[] pkValues = brokerForClass.serviceBrokerHelper().getValues(pkFields, obj, true);
 
                 Criteria criteria = new Criteria();
                 for (int j = 0; j < pkFields.length; j++)

Modified: db/ojb/trunk/src/java/org/apache/ojb/odmg/collections/DSetImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/odmg/collections/DSetImpl.java?view=diff&rev=495677&r1=495676&r2=495677
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/odmg/collections/DSetImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/odmg/collections/DSetImpl.java Fri Jan 12 10:19:39 2007
@@ -323,7 +323,7 @@
                 ClassDescriptor cld = broker.getClassDescriptor(obj.getClass());
 
                 FieldDescriptor[] pkFields = cld.getPkFields();
-                ValueContainer[] pkValues = broker.serviceBrokerHelper().getKeyValues(cld, obj);
+                ValueContainer[] pkValues = broker.serviceBrokerHelper().getValues(pkFields, obj, true);
 
                 Criteria criteria = new Criteria();
                 for (int j = 0; j < pkFields.length; j++)



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message