db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject cvs commit: db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb OjbTagsHandler.java
Date Wed, 02 Mar 2005 22:44:13 GMT
tomdz       2005/03/02 14:44:13

  Modified:    src/xdoclet/test/xdoclet/modules/ojb/tests Tag:
                        OJB_1_0_RELEASE RunAllTests.java
               lib      Tag: OJB_1_0_RELEASE xdoclet-ojb-module-1.2.2.jar
               src/xdoclet/java/src/xdoclet/modules/ojb/model Tag:
                        OJB_1_0_RELEASE TorqueModelDef.java
                        PropertyHelper.java
               src/xdoclet/java/src/xdoclet/modules/ojb/resources Tag:
                        OJB_1_0_RELEASE intermediate-representation.xdt
               src/xdoclet/java/src/xdoclet/modules/ojb/constraints Tag:
                        OJB_1_0_RELEASE ModelConstraints.java
               src/xdoclet/java/src/xdoclet/modules/ojb Tag:
                        OJB_1_0_RELEASE OjbTagsHandler.java
  Added:       src/xdoclet/test/xdoclet/modules/ojb/tests Tag:
                        OJB_1_0_RELEASE
                        CollectionTagIndirectionTablePrimarykeysAttributeTests.java
  Log:
  Added new attribute 'indirection-table-primarykeys' to the @ojb.collection tag that specifies
whether the columns pointing to the owner/element classes, shall be primarykeys in the indirection
table
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.13.2.2  +1 -0      db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/RunAllTests.java
  
  Index: RunAllTests.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/RunAllTests.java,v
  retrieving revision 1.13.2.1
  retrieving revision 1.13.2.2
  diff -u -r1.13.2.1 -r1.13.2.2
  --- RunAllTests.java	1 Mar 2005 21:54:06 -0000	1.13.2.1
  +++ RunAllTests.java	2 Mar 2005 22:44:13 -0000	1.13.2.2
  @@ -105,6 +105,7 @@
           suite.addTest(new TestSuite(CollectionTagForeignkeyAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagIndirectionTableAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagIndirectionTableDocumentationAttributesTests.class));
  +        suite.addTest(new TestSuite(CollectionTagIndirectionTablePrimarykeysAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagOrderbyAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagOtmDependentAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagProxyAttributeTests.class));
  
  
  
  No                   revision
  
  Index: RunAllTests.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/RunAllTests.java,v
  retrieving revision 1.13.2.1
  retrieving revision 1.13.2.2
  diff -u -r1.13.2.1 -r1.13.2.2
  --- RunAllTests.java	1 Mar 2005 21:54:06 -0000	1.13.2.1
  +++ RunAllTests.java	2 Mar 2005 22:44:13 -0000	1.13.2.2
  @@ -105,6 +105,7 @@
           suite.addTest(new TestSuite(CollectionTagForeignkeyAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagIndirectionTableAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagIndirectionTableDocumentationAttributesTests.class));
  +        suite.addTest(new TestSuite(CollectionTagIndirectionTablePrimarykeysAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagOrderbyAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagOtmDependentAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagProxyAttributeTests.class));
  
  
  
  No                   revision
  
  Index: RunAllTests.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/RunAllTests.java,v
  retrieving revision 1.13.2.1
  retrieving revision 1.13.2.2
  diff -u -r1.13.2.1 -r1.13.2.2
  --- RunAllTests.java	1 Mar 2005 21:54:06 -0000	1.13.2.1
  +++ RunAllTests.java	2 Mar 2005 22:44:13 -0000	1.13.2.2
  @@ -105,6 +105,7 @@
           suite.addTest(new TestSuite(CollectionTagForeignkeyAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagIndirectionTableAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagIndirectionTableDocumentationAttributesTests.class));
  +        suite.addTest(new TestSuite(CollectionTagIndirectionTablePrimarykeysAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagOrderbyAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagOtmDependentAttributeTests.class));
           suite.addTest(new TestSuite(CollectionTagProxyAttributeTests.class));
  
  
  
  1.1.2.1   +605 -0    db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/Attic/CollectionTagIndirectionTablePrimarykeysAttributeTests.java
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.2   +166 -180  db-ojb/lib/Attic/xdoclet-ojb-module-1.2.2.jar
  
  	<<Binary file>>
  
  
  No                   revision
  No                   revision
  1.6.2.2   +9 -0      db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java
  
  Index: TorqueModelDef.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java,v
  retrieving revision 1.6.2.1
  retrieving revision 1.6.2.2
  diff -u -r1.6.2.1 -r1.6.2.2
  --- TorqueModelDef.java	1 Mar 2005 21:54:08 -0000	1.6.2.1
  +++ TorqueModelDef.java	2 Mar 2005 22:44:13 -0000	1.6.2.2
  @@ -370,6 +370,7 @@
           CommaListIterator  remoteKeyDocs    = new CommaListIterator(collDef.getProperty(PropertyHelper.OJB_PROPERTY_REMOTE_FOREIGNKEY_DOCUMENTATION));
           ArrayList          localColumns     = new ArrayList();
           ArrayList          remoteColumns    = new ArrayList();
  +        boolean            asPrimarykeys    = collDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_INDIRECTION_TABLE_PRIMARYKEYS,
true);
           FieldDescriptorDef fieldDef;
           ColumnDef          columnDef;
           String             relationName;
  @@ -388,6 +389,10 @@
               }
               columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_TYPE, fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE));
               columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_SIZE, fieldDef.getSizeConstraint());
  +            if (asPrimarykeys)
  +            {
  +                columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_PRIMARYKEY, "true");
  +            }
               if (localKeyDocs.hasNext())
               {
                   columnDef.setProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION, localKeyDocs.getNext());
  @@ -419,6 +424,10 @@
               }
               columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_TYPE, fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE));
               columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_SIZE, fieldDef.getSizeConstraint());
  +            if (asPrimarykeys)
  +            {
  +                columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_PRIMARYKEY, "true");
  +            }
               if (remoteKeyDocs.hasNext())
               {
                   columnDef.setProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION, remoteKeyDocs.getNext());
  
  
  
  1.6.2.2   +2 -0      db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/model/PropertyHelper.java
  
  Index: PropertyHelper.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/model/PropertyHelper.java,v
  retrieving revision 1.6.2.1
  retrieving revision 1.6.2.2
  diff -u -r1.6.2.1 -r1.6.2.2
  --- PropertyHelper.java	1 Mar 2005 21:54:08 -0000	1.6.2.1
  +++ PropertyHelper.java	2 Mar 2005 22:44:13 -0000	1.6.2.2
  @@ -60,6 +60,7 @@
       public static final String OJB_PROPERTY_INCLUDE_INHERITED               = "include-inherited";
       public static final String OJB_PROPERTY_INDIRECTION_TABLE               = "indirection-table";
       public static final String OJB_PROPERTY_INDIRECTION_TABLE_DOCUMENTATION = "indirection-table-documentation";
  +    public static final String OJB_PROPERTY_INDIRECTION_TABLE_PRIMARYKEYS   = "indirection-table-primarykeys";
       public static final String OJB_PROPERTY_INITIALIZATION_METHOD           = "initialization-method";
       public static final String OJB_PROPERTY_ISOLATION_LEVEL                 = "isolation-level";
       public static final String OJB_PROPERTY_JAVA_TYPE                       = "java-type";
  @@ -192,6 +193,7 @@
           collectionProperties.put(OJB_PROPERTY_IGNORE, null);
           collectionProperties.put(OJB_PROPERTY_INDIRECTION_TABLE, null);
           collectionProperties.put(OJB_PROPERTY_INDIRECTION_TABLE_DOCUMENTATION, null);
  +        collectionProperties.put(OJB_PROPERTY_INDIRECTION_TABLE_PRIMARYKEYS, null);
           collectionProperties.put(OJB_PROPERTY_ORDERBY, null);
           collectionProperties.put(OJB_PROPERTY_OTM_DEPENDENT, null);
           collectionProperties.put(OJB_PROPERTY_PROXY, null);
  
  
  
  No                   revision
  No                   revision
  1.8.2.2   +1 -0      db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/resources/intermediate-representation.xdt
  
  Index: intermediate-representation.xdt
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/resources/intermediate-representation.xdt,v
  retrieving revision 1.8.2.1
  retrieving revision 1.8.2.2
  diff -u -r1.8.2.1 -r1.8.2.2
  --- intermediate-representation.xdt	1 Mar 2005 21:54:09 -0000	1.8.2.1
  +++ intermediate-representation.xdt	2 Mar 2005 22:44:13 -0000	1.8.2.2
  @@ -432,6 +432,7 @@
                       foreignkey-documentation="<XDtOjbMember:memberTagValue tagName='ojb.collection'
paramName='foreignkey-documentation'/>"
                       indirection-table="<XDtOjbMember:memberTagValue tagName='ojb.collection'
paramName='indirection-table'/>"
                       indirection-table-documentation="<XDtOjbMember:memberTagValue tagName='ojb.collection'
paramName='indirection-table-documentation'/>"
  +                    indirection-table-primarykeys="<XDtOjbMember:memberTagValue tagName='ojb.collection'
paramName='indirection-table-primarykeys' values='true,false'/>"
                       orderby="<XDtOjbMember:memberTagValue tagName='ojb.collection' paramName='orderby'/>"
                       otm-dependent="<XDtOjbMember:memberTagValue tagName='ojb.collection'
paramName='otm-dependent' values='true,false'/>"
                       proxy="<XDtOjbMember:memberTagValue tagName='ojb.collection' paramName='proxy'
values='true,false'/>"
  
  
  
  No                   revision
  No                   revision
  1.6.2.3   +11 -11    db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ModelConstraints.java
  
  Index: ModelConstraints.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ModelConstraints.java,v
  retrieving revision 1.6.2.2
  retrieving revision 1.6.2.3
  diff -u -r1.6.2.2 -r1.6.2.3
  --- ModelConstraints.java	1 Mar 2005 21:54:08 -0000	1.6.2.2
  +++ ModelConstraints.java	2 Mar 2005 22:44:13 -0000	1.6.2.3
  @@ -101,7 +101,7 @@
   
           if ((foreignkey == null) || (foreignkey.length() == 0))
           {
  -            throw new ConstraintException("The collection "+collDef.getName()+" has no
foreignkeys");
  +            throw new ConstraintException("The collection "+collDef.getName()+" in class
"+collDef.getOwner().getName()+" has no foreignkeys");
           }
   
           // we know that the class is present because the collection constraints have been
checked already
  @@ -187,7 +187,7 @@
   
           if ((foreignkey == null) || (foreignkey.length() == 0))
           {
  -            throw new ConstraintException("The collection "+collDef.getName()+" has no
foreignkeys");
  +            throw new ConstraintException("The collection "+collDef.getName()+" in class
"+collDef.getOwner().getName()+" has no foreignkeys");
           }
   
           ClassDescriptorDef ownerClass = (ClassDescriptorDef)collDef.getOwner();
  @@ -221,18 +221,18 @@
               }
               catch (NoSuchFieldException ex)
               {
  -                throw new ConstraintException("The collection "+collDef.getName()+" specifies
a foreignkey "+ex.getMessage()+" that is not a persistent field in the element class (or its
subclass) "+elementClass.getName());
  +                throw new ConstraintException("The collection "+collDef.getName()+" in
class "+collDef.getOwner().getName()+" specifies a foreignkey "+ex.getMessage()+" that is
not a persistent field in the element class (or its subclass) "+elementClass.getName());
               }
               if (primFields.size() != keyFields.size())
               {
  -                throw new ConstraintException("The number of foreignkeys ("+keyFields.size()+")
of the collection "+collDef.getName()+" doesn't match the number of primarykeys ("+primFields.size()+")
of its owner class "+ownerClass.getName());
  +                throw new ConstraintException("The number of foreignkeys ("+keyFields.size()+")
of the collection "+collDef.getName()+" in class "+collDef.getOwner().getName()+" doesn't
match the number of primarykeys ("+primFields.size()+") of its owner class "+ownerClass.getName());
               }
               for (int idx = 0; idx < keyFields.size(); idx++)
               {
                   keyField  = (FieldDescriptorDef)keyFields.get(idx);
                   if (keyField.getBooleanProperty(PropertyHelper.OJB_PROPERTY_IGNORE, false))
                   {
  -                    throw new ConstraintException("The collection "+collDef.getName()+"
in the class "+ownerClass.getName()+" uses the field "+keyField.getName()+" as foreignkey
although this field is ignored in the element class (or its subclass) "+elementClass.getName());
  +                    throw new ConstraintException("The collection "+collDef.getName()+"
in class "+ownerClass.getName()+" uses the field "+keyField.getName()+" as foreignkey although
this field is ignored in the element class (or its subclass) "+elementClass.getName());
                   }
               }
               // the jdbc types of the primary keys must match the jdbc types of the foreignkeys
(in the correct order)
  @@ -241,7 +241,7 @@
                   keyField  = (FieldDescriptorDef)keyFields.get(idx);
                   if (keyField.getBooleanProperty(PropertyHelper.OJB_PROPERTY_IGNORE, false))
                   {
  -                    throw new ConstraintException("The collection "+collDef.getName()+"
in the class "+ownerClass.getName()+" uses the field "+keyField.getName()+" as foreignkey
although this field is ignored in the element class (or its subclass) "+elementClass.getName());
  +                    throw new ConstraintException("The collection "+collDef.getName()+"
in class "+ownerClass.getName()+" uses the field "+keyField.getName()+" as foreignkey although
this field is ignored in the element class (or its subclass) "+elementClass.getName());
                   }
                   primField = (FieldDescriptorDef)primFields.get(idx);
                   primType  = primField.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE);
  @@ -298,7 +298,7 @@
   
           if ((foreignkey == null) || (foreignkey.length() == 0))
           {
  -            throw new ConstraintException("The reference "+refDef.getName()+" has no foreignkeys");
  +            throw new ConstraintException("The reference "+refDef.getName()+" in class
"+refDef.getOwner().getName()+" has no foreignkeys");
           }
   
           // we know that the class is present because the reference constraints have been
checked already
  @@ -312,14 +312,14 @@
           }
           catch (NoSuchFieldException ex)
           {
  -            throw new ConstraintException("The reference "+refDef.getName()+" specifies
a foreignkey "+ex.getMessage()+" that is not a persistent field in its owner class "+ownerClass.getName());
  +            throw new ConstraintException("The reference "+refDef.getName()+" in class
"+refDef.getOwner().getName()+" specifies a foreignkey "+ex.getMessage()+" that is not a persistent
field in its owner class "+ownerClass.getName());
           }
           for (int idx = 0; idx < keyFields.size(); idx++)
           {
               keyField = (FieldDescriptorDef)keyFields.get(idx);
               if (keyField.getBooleanProperty(PropertyHelper.OJB_PROPERTY_IGNORE, false))
               {
  -                throw new ConstraintException("The reference "+refDef.getName()+" in the
class "+ownerClass.getName()+" uses the field "+keyField.getName()+" as foreignkey although
this field is ignored in this class");
  +                throw new ConstraintException("The reference "+refDef.getName()+" in class
"+ownerClass.getName()+" uses the field "+keyField.getName()+" as foreignkey although this
field is ignored in this class");
               }
           }
               
  @@ -351,7 +351,7 @@
               primFields = referencedClass.getPrimaryKeys();
               if (primFields.size() != keyFields.size())
               {
  -                throw new ConstraintException("The number of foreignkeys ("+keyFields.size()+")
of the reference "+refDef.getName()+" doesn't match the number of primarykeys ("+primFields.size()+")
of the referenced class (or its subclass) "+referencedClass.getName());
  +                throw new ConstraintException("The number of foreignkeys ("+keyFields.size()+")
of the reference "+refDef.getName()+" in class "+refDef.getOwner().getName()+" doesn't match
the number of primarykeys ("+primFields.size()+") of the referenced class (or its subclass)
"+referencedClass.getName());
               }
               for (int idx = 0; idx < primFields.size(); idx++)
               {
  @@ -361,7 +361,7 @@
                   keyType   = keyField.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE);
                   if (!primType.equals(keyType))
                   {
  -                    throw new ConstraintException("The jdbc-type of foreignkey "+keyField.getName()+"
of the reference "+refDef.getName()+" doesn't match the jdbc-type of the corresponding primarykey
"+primField.getName()+" of the referenced class (or its subclass) "+referencedClass.getName());
  +                    throw new ConstraintException("The jdbc-type of foreignkey "+keyField.getName()+"
of the reference "+refDef.getName()+" in class "+refDef.getOwner().getName()+" doesn't match
the jdbc-type of the corresponding primarykey "+primField.getName()+" of the referenced class
(or its subclass) "+referencedClass.getName());
                   }
               }
           }
  
  
  
  No                   revision
  No                   revision
  1.13.2.3  +2 -0      db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java
  
  Index: OjbTagsHandler.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java,v
  retrieving revision 1.13.2.2
  retrieving revision 1.13.2.3
  diff -u -r1.13.2.2 -r1.13.2.3
  --- OjbTagsHandler.java	1 Mar 2005 21:54:08 -0000	1.13.2.2
  +++ OjbTagsHandler.java	2 Mar 2005 22:44:13 -0000	1.13.2.3
  @@ -996,6 +996,8 @@
        *      table for m:n associations"
        * @doc.param                   name="indirection-table-documentation" optional="true"
description="Documentation
        *      on the indirection table"
  +     * @doc.param                   name="indirection-table-primarykeys" optional="true"
description="Whether the
  +     *      fields referencing the collection and element classes, should also be primarykeys"
        * @doc.param                   name="otm-dependent" optional="true" description="Whether
the collection is dependent on otm"
        * @doc.param                   name="proxy" optional="true" description="Whether to
use a proxy for the collection"
        * @doc.param                   name="proxy-prefetching-limit" optional="true" description="Specifies
the amount of objects to prefetch"
  
  
  

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