arminw      2005/04/22 09:44:14

  Modified:    src/java/org/apache/ojb/broker/util/sequence Tag:
                        OJB_1_0_RELEASE HighLowSequence.java
                        SequenceManager.java
                        SequenceManagerHighLowImpl.java
  Removed:     src/java/org/apache/ojb/broker/util/sequence Tag:
                        OJB_1_0_RELEASE SequenceManagerMySQLImpl.java
  Log:
  remove deprecated SM impl class
  remove unused field in HLSequence class
  remove unused method from SequenceManager interface
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.11.2.1  +15 -37    
db-ojb/src/java/org/apache/ojb/broker/util/sequence/HighLowSequence.java
  
  Index: HighLowSequence.java
  ===================================================================
  RCS file: 
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/sequence/HighLowSequence.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- HighLowSequence.java      11 May 2004 17:19:40 -0000      1.11
  +++ HighLowSequence.java      22 Apr 2005 16:44:14 -0000      1.11.2.1
  @@ -28,8 +28,8 @@
    */
   public class HighLowSequence implements Serializable
   {
  -     static final long serialVersionUID = -2174468157880921393L;    private 
String tableName;
  -    private String fieldName;
  +     static final long serialVersionUID = -2174468157880921393L;
  +    private String name;
       private long maxKey;
       private int grabSize;
       private Integer version;
  @@ -43,13 +43,12 @@
       {
           // make sure that version column in DB is never 'null'
           // to avoid problems with
  -        this(null, null, 0, 0, new Integer(0));
  +        this(null, 0, 0, new Integer(0));
       }
   
  -    public HighLowSequence(String tableName, String fieldName, long maxKey, 
int grabSize, Integer version)
  +    public HighLowSequence(String tableName, long maxKey, int grabSize, 
Integer version)
       {
  -        this.tableName = tableName;
  -        this.fieldName = fieldName;
  +        this.name = tableName;
           this.maxKey = maxKey;
           this.grabSize = grabSize;
           this.version = version;
  @@ -57,7 +56,7 @@
   
       public HighLowSequence getCopy()
       {
  -        HighLowSequence result = new HighLowSequence(this.tableName, 
this.fieldName, this.maxKey, this.grabSize, this.version);
  +        HighLowSequence result = new HighLowSequence(this.name, this.maxKey, 
this.grabSize, this.version);
           result.curVal = this.curVal;
           return result;
       }
  @@ -65,8 +64,7 @@
       public String toString()
       {
           ToStringBuilder buf = new ToStringBuilder(this, 
ToStringStyle.DEFAULT_STYLE);
  -        buf.append("tableName", tableName).
  -                append("fieldName", fieldName).
  +        buf.append("name", name).
                   append("grabSize", grabSize).
                   append("version", version).
                   append("maxKey", maxKey).
  @@ -85,13 +83,13 @@
       }
   
       /**
  -     * Sets the className attribute of the HighLowSequence object
  +     * Sets the name attribute of the HighLowSequence object
        *
  -     * @param tableName  The new className value
  +     * @param name  The new className value
        */
  -    public void setTableName(String tableName)
  +    public void setName(String name)
       {
  -        this.tableName = tableName;
  +        this.name = name;
       }
   
       /**
  @@ -105,16 +103,6 @@
       }
   
       /**
  -     * Sets the fieldName attribute of the HighLowSequence object
  -     *
  -     * @param fieldName  The new fieldName value
  -     */
  -    public void setFieldName(String fieldName)
  -    {
  -        this.fieldName = fieldName;
  -    }
  -
  -    /**
        * Sets the maxKey attribute of the HighLowSequence object
        *
        * @param maxKey  The new maxKey value
  @@ -125,13 +113,13 @@
       }
   
       /**
  -     * Gets the className attribute of the HighLowSequence object
  +     * Gets the name attribute of the HighLowSequence object
        *
        * @return   The className value
        */
  -    public String getTableName()
  +    public String getName()
       {
  -        return this.tableName;
  +        return this.name;
       }
   
       /**
  @@ -145,16 +133,6 @@
       }
   
       /**
  -     * Gets the fieldName attribute of the HighLowSequence object
  -     *
  -     * @return   The fieldName value
  -     */
  -    public String getFieldName()
  -    {
  -        return this.fieldName;
  -    }
  -
  -    /**
        * Gets the next key from this sequence
        *
        * @return   The next key or 0 if sequence needs to grab new keyset
  
  
  
  1.10.2.2  +1 -14     
db-ojb/src/java/org/apache/ojb/broker/util/sequence/SequenceManager.java
  
  Index: SequenceManager.java
  ===================================================================
  RCS file: 
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/sequence/SequenceManager.java,v
  retrieving revision 1.10.2.1
  retrieving revision 1.10.2.2
  diff -u -r1.10.2.1 -r1.10.2.2
  --- SequenceManager.java      10 Mar 2005 17:55:31 -0000      1.10.2.1
  +++ SequenceManager.java      22 Apr 2005 16:44:14 -0000      1.10.2.2
  @@ -60,17 +60,4 @@
        * @param obj
        */
       public void afterStore(JdbcAccess dbAccess, ClassDescriptor cld, Object 
obj) throws SequenceManagerException;
  -
  -    /**
  -     * This is used for database auto_increment/identity columns to set the 
reference
  -     * foreign keys after they've
  -     * been assigned by the db.
  -     * <p>
  -     * This can be ignored by high/low implementations
  -     * <p>
  -     * Travis Reeder
  -     * @param obj
  -     * @param cld
  -     */
  -    public void setReferenceFKs(Object obj, ClassDescriptor cld) throws 
SequenceManagerException;
   }
  
  
  
  1.29.2.2  +5 -13     
db-ojb/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java
  
  Index: SequenceManagerHighLowImpl.java
  ===================================================================
  RCS file: 
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java,v
  retrieving revision 1.29.2.1
  retrieving revision 1.29.2.2
  diff -u -r1.29.2.1 -r1.29.2.2
  --- SequenceManagerHighLowImpl.java   4 Oct 2004 15:00:13 -0000       1.29.2.1
  +++ SequenceManagerHighLowImpl.java   22 Apr 2005 16:44:14 -0000      1.29.2.2
  @@ -19,13 +19,11 @@
   import java.util.Map;
   
   import org.apache.commons.lang.SystemUtils;
  +import org.apache.ojb.broker.Identity;
   import org.apache.ojb.broker.OptimisticLockException;
   import org.apache.ojb.broker.PersistenceBroker;
   import org.apache.ojb.broker.PersistenceBrokerFactory;
   import org.apache.ojb.broker.metadata.FieldDescriptor;
  -import org.apache.ojb.broker.query.Criteria;
  -import org.apache.ojb.broker.query.Query;
  -import org.apache.ojb.broker.query.QueryByCriteria;
   import org.apache.ojb.broker.util.ObjectModificationDefaultImpl;
   import org.apache.ojb.broker.util.logging.Logger;
   import org.apache.ojb.broker.util.logging.LoggerFactory;
  @@ -119,8 +117,6 @@
       public static final String PROPERTY_GLOBAL_SEQUENCE_ID = 
"globalSequenceId";
       public static final String PROPERTY_GLOBAL_SEQUENCE_START = 
"globalSequenceStart";
       public static final String PROPERTY_SEQUENCE_START = "sequenceStart";
  -    private static final String DEPRECATED_COLUMN = "deprecatedColumn";
  -    private static final String PK_FIELD = "tableName";
   
       protected static Map sequencesDBMap = new HashMap();
   
  @@ -289,12 +285,9 @@
           HighLowSequence newSequence = null;
           boolean needsInsert = false;
   
  -        Criteria c = new Criteria();
  -        c.addEqualTo(PK_FIELD, seqName);
  -        Query q = new QueryByCriteria(HighLowSequence.class, c);
  -
  +        Identity oid = 
broker.serviceIdentity().buildIdentity(HighLowSequence.class, seqName);
           // first we lookup sequence object in database
  -        newSequence = (HighLowSequence) broker.getObjectByQuery(q);
  +        newSequence = (HighLowSequence) broker.getObjectByIdentity(oid);
   
           //not in db --> we have to store a new sequence
           if (newSequence == null)
  @@ -350,8 +343,7 @@
                                                 FieldDescriptor field)
       {
           HighLowSequence seq = new HighLowSequence();
  -        seq.setTableName(sequenceName);
  -        seq.setFieldName(DEPRECATED_COLUMN);
  +        seq.setName(sequenceName);
           seq.setGrabSize(grabSize);
           return seq;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to