db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata ObjectReferenceDescriptor.java
Date Thu, 13 Jan 2005 17:29:52 GMT
brj         2005/01/13 09:29:52

  Modified:    src/java/org/apache/ojb/broker/metadata
                        ObjectReferenceDescriptor.java
  Log:
  convert the vector of strings to ForeignKeys
  
  Revision  Changes    Path
  1.44      +18 -7     db-ojb/src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java
  
  Index: ObjectReferenceDescriptor.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- ObjectReferenceDescriptor.java	9 Jan 2005 10:12:56 -0000	1.43
  +++ ObjectReferenceDescriptor.java	13 Jan 2005 17:29:52 -0000	1.44
  @@ -18,6 +18,7 @@
   import java.io.Serializable;
   import java.util.ArrayList;
   import java.util.HashMap;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
   import java.util.Vector;
  @@ -252,7 +253,7 @@
       }
   
       /**
  -     *
  +     * Answer a Vector of ForeignKey.
        */
       public Vector getForeignKeyFields()
       {
  @@ -260,15 +261,22 @@
       }
   
       /**
  -     *
  +     * Sets the foreign keys.
  +     * @param vec a Vector of Strings or Integers (the names or ids of the fields)
        */
       public void setForeignKeyFields(Vector vec)
       {
  -        m_ForeignKeyFields = vec;
  +        Iterator iter = vec.iterator();
  +        
  +        while (iter.hasNext())
  +        {
  +            addForeignKeyField(iter.next(), null);
  +        }
       }
   
       /**
  -     * add a foreign key field ID
  +     * Add a foreign key field ID.
  +     * @param fkId the id the foreign key field
        */
       public void addForeignKeyField(int fkId)
       {
  @@ -276,7 +284,8 @@
       }
   
       /**
  -     * add a foreign key field
  +     * Add a foreign key field.
  +     * @param fkField the id or name of the foreign key field
        */
       public void addForeignKeyField(String fkField)
       {
  @@ -284,7 +293,9 @@
       }
   
       /**
  -     * add a foreign key field
  +     * Add a foreign key field.
  +     * @param fkField the id or name of the foreign key field
  +     * @param targetField the name of the target field
        */
       public void addForeignKeyField(Object fkField, String targetField)
       {
  @@ -705,7 +716,7 @@
       /**
        * Helper to store the fkField and the field it's referencing.
        */
  -    protected static class ForeignKey implements Serializable
  +    static class ForeignKey implements Serializable
       {
           private static final long serialVersionUID = 3256718468362482741L;
   
  
  
  

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