db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r463749 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerInMemoryImpl.java
Date Fri, 13 Oct 2006 17:41:11 GMT
Author: arminw
Date: Fri Oct 13 10:41:10 2006
New Revision: 463749

URL: http://svn.apache.org/viewvc?view=rev&rev=463749
Log:
update sequence package to support per field-descriptor sequence manager declaration

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerInMemoryImpl.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerInMemoryImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerInMemoryImpl.java?view=diff&rev=463749&r1=463748&r2=463749
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerInMemoryImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerInMemoryImpl.java
Fri Oct 13 10:41:10 2006
@@ -17,6 +17,7 @@
 
 import org.apache.ojb.broker.PersistenceBroker;
 import org.apache.ojb.broker.metadata.FieldDescriptor;
+import org.apache.ojb.broker.metadata.SequenceDescriptor;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -77,11 +78,8 @@
  * <br/>
  *
  * @see org.apache.ojb.broker.util.sequence.SequenceManager
- * @see org.apache.ojb.broker.util.sequence.SequenceManagerFactory
  * @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
@@ -89,6 +87,9 @@
     protected static Map sequencesDBMap = new HashMap();
     private long sequenceStart;
 
+    /**
+     * @deprecated
+     */
     public SequenceManagerInMemoryImpl(PersistenceBroker broker)
     {
         super(broker);
@@ -96,6 +97,13 @@
         sequenceStart = start != null ? start.longValue() : 1;
     }
 
+    public SequenceManagerInMemoryImpl(PersistenceBroker broker, SequenceDescriptor descriptor)
+    {
+        super(broker, descriptor);
+        Long start = SequenceManagerHelper.getSeqStart(getConfigurationProperties());
+        sequenceStart = start != null ? start.longValue() : 1;
+    }
+
     protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
     {
         String seqName = calculateSequenceName(field);
@@ -174,5 +182,15 @@
                 mapForDB.remove(sequenceName);
             }
         }
+    }
+
+    public long getSequenceStart()
+    {
+        return sequenceStart;
+    }
+
+    public void setSequenceStart(long sequenceStart)
+    {
+        this.sequenceStart = sequenceStart;
     }
 }



---------------------------------------------------------------------
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