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/lib xdoclet-ojb-module-1.2.1.jar
Date Mon, 28 Jun 2004 20:42:19 GMT
tomdz       2004/06/28 13:42:19

  Modified:    src/xdoclet/test/xdoclet/modules/ojb/tests
                        ReferenceTagClassRefAttributeTests.java
               src/xdoclet/java/src/xdoclet/modules/ojb OjbTagsHandler.java
               lib      xdoclet-ojb-module-1.2.1.jar
  Log:
  Fixed error where feature tags were not inherited from implemented interfaces
  
  Revision  Changes    Path
  1.5       +139 -0    db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/ReferenceTagClassRefAttributeTests.java
  
  Index: ReferenceTagClassRefAttributeTests.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/ReferenceTagClassRefAttributeTests.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ReferenceTagClassRefAttributeTests.java	25 Jun 2004 13:36:49 -0000	1.4
  +++ ReferenceTagClassRefAttributeTests.java	28 Jun 2004 20:42:19 -0000	1.5
  @@ -876,4 +876,143 @@
               "</database>",
               runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest"));
       }
  +
  +    // Test: no class-ref attribute specified, reference to interface
  +    public void testClassRef18()
  +    {
  +        addClass(
  +            "test.A",
  +            "package test;\n"+
  +            "/** @ojb.class table=\"A\" */\n"+
  +            "public interface A {\n"+
  +            "  /** @ojb.field primarykey=\"true\" */\n"+
  +            "  public Integer getId();\n"+
  +            "  /** @ojb.field length=\"254\" */\n"+
  +            "  public String getOjbConcreteClass();\n"+
  +            "}\n");
  +        addClass(
  +            "test.B",
  +            "package test;\n"+
  +            "/** @ojb.class table=\"A\" */\n"+
  +            "public class B implements A {\n"+
  +            "  private Integer id;\n"+
  +            "  private String ojbConcreteClass;\n"+
  +            "  public Integer getId() {\n"+
  +            "    return id;\n"+
  +            "  }\n"+
  +            "  public String getOjbConcreteClass() {\n"+
  +            "    return ojbConcreteClass;\n"+
  +            "  }\n"+
  +            "}\n");
  +        addClass(
  +            "test.C",
  +            "package test;\n"+
  +            "/** @ojb.class */\n"+
  +            "public class C {\n"+
  +            "  /** @ojb.field primarykey=\"true\" */\n"+
  +            "  private Integer id;\n"+
  +            "  /** @ojb.field */\n"+
  +            "  private Integer aid;\n"+
  +            "  /** @ojb.reference foreignkey=\"aid\" */\n"+
  +            "  private test.A attr;\n"+
  +            "}\n");
  +
  +        assertEqualsOjbDescriptorFile(
  +            "<class-descriptor\n"+
  +            "    class=\"test.A\"\n"+
  +            "    table=\"A\"\n"+
  +            ">\n"+
  +            "    <extent-class class-ref=\"test.B\"/>\n"+
  +            "    <field-descriptor\n"+
  +            "        name=\"id\"\n"+
  +            "        column=\"id\"\n"+
  +            "        jdbc-type=\"INTEGER\"\n"+
  +            "        primarykey=\"true\"\n"+
  +            "    >\n"+
  +            "    </field-descriptor>\n"+
  +            "    <field-descriptor\n"+
  +            "        name=\"ojbConcreteClass\"\n"+
  +            "        column=\"ojbConcreteClass\"\n"+
  +            "        jdbc-type=\"VARCHAR\"\n"+
  +            "        length=\"254\"\n"+
  +            "    >\n"+
  +            "    </field-descriptor>\n"+
  +            "</class-descriptor>\n"+
  +            "<class-descriptor\n"+
  +            "    class=\"test.B\"\n"+
  +            "    table=\"A\"\n"+
  +            ">\n"+
  +            "    <field-descriptor\n"+
  +            "        name=\"id\"\n"+
  +            "        column=\"id\"\n"+
  +            "        jdbc-type=\"INTEGER\"\n"+
  +            "        primarykey=\"true\"\n"+
  +            "    >\n"+
  +            "    </field-descriptor>\n"+
  +            "    <field-descriptor\n"+
  +            "        name=\"ojbConcreteClass\"\n"+
  +            "        column=\"ojbConcreteClass\"\n"+
  +            "        jdbc-type=\"VARCHAR\"\n"+
  +            "        length=\"254\"\n"+
  +            "    >\n"+
  +            "    </field-descriptor>\n"+
  +            "</class-descriptor>\n"+
  +            "<class-descriptor\n"+
  +            "    class=\"test.C\"\n"+
  +            "    table=\"C\"\n"+
  +            ">\n"+
  +            "    <field-descriptor\n"+
  +            "        name=\"id\"\n"+
  +            "        column=\"id\"\n"+
  +            "        jdbc-type=\"INTEGER\"\n"+
  +            "        primarykey=\"true\"\n"+
  +            "    >\n"+
  +            "    </field-descriptor>\n"+
  +            "    <field-descriptor\n"+
  +            "        name=\"aid\"\n"+
  +            "        column=\"aid\"\n"+
  +            "        jdbc-type=\"INTEGER\"\n"+
  +            "    >\n"+
  +            "    </field-descriptor>\n"+
  +            "    <reference-descriptor\n"+
  +            "        name=\"attr\"\n"+
  +            "        class-ref=\"test.A\"\n"+
  +            "    >\n"+
  +            "        <foreignkey field-ref=\"aid\"/>\n"+
  +            "    </reference-descriptor>\n"+
  +            "</class-descriptor>",
  +            runOjbXDoclet(OJB_DEST_FILE));
  +        assertEqualsTorqueSchemaFile(
  +            "<database name=\"ojbtest\">\n"+
  +            "    <table name=\"A\">\n"+
  +            "        <column name=\"id\"\n"+
  +            "                javaName=\"id\"\n"+
  +            "                type=\"INTEGER\"\n"+
  +            "                primaryKey=\"true\"\n"+
  +            "                required=\"true\"\n"+
  +            "        />\n"+
  +            "        <column name=\"ojbConcreteClass\"\n"+
  +            "                javaName=\"ojbConcreteClass\"\n"+
  +            "                type=\"VARCHAR\"\n"+
  +            "                size=\"254\"\n"+
  +            "        />\n"+
  +            "    </table>\n"+
  +            "    <table name=\"C\">\n"+
  +            "        <column name=\"id\"\n"+
  +            "                javaName=\"id\"\n"+
  +            "                type=\"INTEGER\"\n"+
  +            "                primaryKey=\"true\"\n"+
  +            "                required=\"true\"\n"+
  +            "        />\n"+
  +            "        <column name=\"aid\"\n"+
  +            "                javaName=\"aid\"\n"+
  +            "                type=\"INTEGER\"\n"+
  +            "        />\n"+
  +            "        <foreign-key foreignTable=\"A\">\n"+
  +            "            <reference local=\"aid\" foreign=\"id\"/>\n"+
  +            "        </foreign-key>\n"+
  +            "    </table>\n"+
  +            "</database>",
  +            runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest"));
  +    }
   }
  
  
  
  1.13      +1 -1      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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- OjbTagsHandler.java	10 Jun 2004 22:34:22 -0000	1.12
  +++ OjbTagsHandler.java	28 Jun 2004 20:42:19 -0000	1.13
  @@ -239,7 +239,7 @@
                   }
                   if (!isFinished)
                   {    
  -                    if (original.isInterface())
  +                    if (original.getInterfaces() != null)
                       {
                           for (Iterator baseIt = original.getInterfaces().iterator(); baseIt.hasNext();)
                           {
  
  
  
  1.2       +106 -91   db-ojb/lib/xdoclet-ojb-module-1.2.1.jar
  
  	<<Binary file>>
  
  

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