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 Sun, 06 Mar 2005 18:53:33 GMT
tomdz       2005/03/06 10:53:33

  Modified:    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
                        torque_xml.xdt
               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
                        ClassTagTableDocumentationAttributeTests.java
                        FieldTagColumnDocumentationAttributeTests.java
  Log:
  Added two new attributes to allow documentation specific for the generated schema:
  
  * table-documentation at ojb.class generates a description of the associated table
  
  * column-documentation at ojb.field generates a description of the associated column
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.3   +113 -117  db-ojb/lib/Attic/xdoclet-ojb-module-1.2.2.jar
  
  	<<Binary file>>
  
  
  No                   revision
  No                   revision
  1.1.2.1   +328 -0    db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/Attic/ClassTagTableDocumentationAttributeTests.java
  
  
  
  
  1.1.2.1   +265 -0    db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/Attic/FieldTagColumnDocumentationAttributeTests.java
  
  
  
  
  No                   revision
  No                   revision
  1.6.2.3   +13 -3     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.2
  retrieving revision 1.6.2.3
  diff -u -r1.6.2.2 -r1.6.2.3
  --- TorqueModelDef.java	2 Mar 2005 22:44:13 -0000	1.6.2.2
  +++ TorqueModelDef.java	6 Mar 2005 18:53:32 -0000	1.6.2.3
  @@ -84,6 +84,11 @@
               tableDef.setProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION,
                                    classDef.getProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION));
           }
  +        if (classDef.hasProperty(PropertyHelper.OJB_PROPERTY_TABLE_DOCUMENTATION))
  +        {
  +            tableDef.setProperty(PropertyHelper.OJB_PROPERTY_TABLE_DOCUMENTATION,
  +                                 classDef.getProperty(PropertyHelper.OJB_PROPERTY_TABLE_DOCUMENTATION));
  +        }
           for (Iterator fieldIt = classDef.getFields(); fieldIt.hasNext();)
           {
               fieldDef = (FieldDescriptorDef)fieldIt.next();
  @@ -175,6 +180,11 @@
               columnDef.setProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION,
                                     fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION));
           }
  +        if (fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_COLUMN_DOCUMENTATION))
  +        {
  +            columnDef.setProperty(PropertyHelper.OJB_PROPERTY_COLUMN_DOCUMENTATION,
  +                                  fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_COLUMN_DOCUMENTATION));
  +        }
           return columnDef;
       }
   
  @@ -346,7 +356,7 @@
           }
           if (collDef.hasProperty(PropertyHelper.OJB_PROPERTY_INDIRECTION_TABLE_DOCUMENTATION))
           {
  -            tableDef.setProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION,
  +            tableDef.setProperty(PropertyHelper.OJB_PROPERTY_TABLE_DOCUMENTATION,
                                    collDef.getProperty(PropertyHelper.OJB_PROPERTY_INDIRECTION_TABLE_DOCUMENTATION));
           }
   
  @@ -395,7 +405,7 @@
               }
               if (localKeyDocs.hasNext())
               {
  -                columnDef.setProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION, localKeyDocs.getNext());
  +                columnDef.setProperty(PropertyHelper.OJB_PROPERTY_COLUMN_DOCUMENTATION,
localKeyDocs.getNext());
               }
               localColumns.add(name);
               remoteColumns.add(fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_COLUMN));
  @@ -430,7 +440,7 @@
               }
               if (remoteKeyDocs.hasNext())
               {
  -                columnDef.setProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION, remoteKeyDocs.getNext());
  +                columnDef.setProperty(PropertyHelper.OJB_PROPERTY_COLUMN_DOCUMENTATION,
remoteKeyDocs.getNext());
               }
               localColumns.add(name);
               remoteColumns.add(fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_COLUMN));
  
  
  
  1.6.2.3   +4 -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.2
  retrieving revision 1.6.2.3
  diff -u -r1.6.2.2 -r1.6.2.3
  --- PropertyHelper.java	2 Mar 2005 22:44:13 -0000	1.6.2.2
  +++ PropertyHelper.java	6 Mar 2005 18:53:32 -0000	1.6.2.3
  @@ -36,6 +36,7 @@
       public static final String OJB_PROPERTY_CLASS_REF                       = "class-ref";
       public static final String OJB_PROPERTY_COLLECTION_CLASS                = "collection-class";
       public static final String OJB_PROPERTY_COLUMN                          = "column";
  +    public static final String OJB_PROPERTY_COLUMN_DOCUMENTATION            = "column-documentation";
       public static final String OJB_PROPERTY_CONVERSION                      = "conversion";
       public static final String OJB_PROPERTY_DATABASE_FOREIGNKEY             = "database-foreignkey";
       public static final String OJB_PROPERTY_DEFAULT_CLASS_REF               = "default-class-ref";
  @@ -86,6 +87,7 @@
       public static final String OJB_PROPERTY_SCALE                           = "scale";
       public static final String OJB_PROPERTY_SEQUENCE_NAME                   = "sequence-name";
       public static final String OJB_PROPERTY_TABLE                           = "table";
  +    public static final String OJB_PROPERTY_TABLE_DOCUMENTATION             = "table-documentation";
       public static final String OJB_PROPERTY_TYPE                            = "type";
       public static final String OJB_PROPERTY_UNIQUE                          = "unique";
       public static final String OJB_PROPERTY_UPDATE_LOCK                     = "update-lock";
  @@ -126,6 +128,7 @@
           classProperties.put(OJB_PROPERTY_REFRESH, null);
           classProperties.put(OJB_PROPERTY_ROW_READER, null);
           classProperties.put(OJB_PROPERTY_TABLE, null);
  +        classProperties.put(OJB_PROPERTY_TABLE_DOCUMENTATION, null);
           
           _properties.put(ClassDescriptorDef.class, classProperties);
   
  @@ -135,6 +138,7 @@
           fieldProperties.put(OJB_PROPERTY_ATTRIBUTES, null);
           fieldProperties.put(OJB_PROPERTY_AUTOINCREMENT, null);
           fieldProperties.put(OJB_PROPERTY_COLUMN, null);
  +        fieldProperties.put(OJB_PROPERTY_COLUMN_DOCUMENTATION, null);
           fieldProperties.put(OJB_PROPERTY_CONVERSION, null);
           fieldProperties.put(OJB_PROPERTY_DEFAULT_CONVERSION, null);
           fieldProperties.put(OJB_PROPERTY_DEFAULT_FETCH, null);
  
  
  
  No                   revision
  No                   revision
  1.8.2.3   +3 -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.2
  retrieving revision 1.8.2.3
  diff -u -r1.8.2.2 -r1.8.2.3
  --- intermediate-representation.xdt	2 Mar 2005 22:44:13 -0000	1.8.2.2
  +++ intermediate-representation.xdt	6 Mar 2005 18:53:32 -0000	1.8.2.3
  @@ -52,12 +52,14 @@
               row-reader="<XDtClass:classTagValue tagName='ojb.class' paramName='row-reader'
superclasses='false'/>"
               schema="<XDtClass:classTagValue tagName='ojb.class' paramName='schema' superclasses='false'/>"
               table="<XDtClass:classTagValue tagName='ojb.class' paramName='table' superclasses='false'/>"
  +            table-documentation="<XDtClass:classTagValue tagName='ojb.class' paramName='table-documentation'
superclasses='false'/>"
           >
               <XDtClass:forAllClassTags tagName="ojb.field" tagKey="name" superclasses="false">
                   <XDtOjb:processAnonymousField
                       attributes="<XDtClass:classTagValue tagName='ojb.field' paramName='attributes'/>"
                       autoincrement="<XDtClass:classTagValue tagName='ojb.field' paramName='autoincrement'
values='none,ojb,database'/>"
                       column="<XDtClass:classTagValue tagName='ojb.field' paramName='column'/>"
  +                    column-documentation="<XDtClass:classTagValue tagName='ojb.field'
paramName='column-documentation'/>"
                       conversion="<XDtClass:classTagValue tagName='ojb.field' paramName='conversion'/>"
                       default-fetch="<XDtClass:classTagValue tagName='ojb.anonymous-feld'
paramName='default-fetch' values='true,false'/>"
                       documentation="<XDtClass:classTagValue tagName='ojb.field' paramName='documentation'/>"
  @@ -383,6 +385,7 @@
                       attributes="<XDtOjbMember:memberTagValue tagName='ojb.field' paramName='attributes'/>"
                       autoincrement="<XDtOjbMember:memberTagValue tagName='ojb.field'
paramName='autoincrement' values='none,ojb,database'/>"
                       column="<XDtOjbMember:memberTagValue tagName='ojb.field' paramName='column'/>"
  +                    column-documentation="<XDtOjbMember:memberTagValue tagName='ojb.field'
paramName='column-documentation'/>"
                       conversion="<XDtOjbMember:memberTagValue tagName='ojb.field' paramName='conversion'/>"
                       default-fetch="<XDtOjbMember:memberTagValue tagName='ojb.field'
paramName='default-fetch' values='true,false'/>"
                       documentation="<XDtOjbMember:memberTagValue tagName='ojb.field'
paramName='documentation'/>"
  
  
  
  1.5.2.2   +17 -5     db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/resources/torque_xml.xdt
  
  Index: torque_xml.xdt
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/resources/torque_xml.xdt,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- torque_xml.xdt	1 Mar 2005 21:54:09 -0000	1.5.2.1
  +++ torque_xml.xdt	6 Mar 2005 18:53:32 -0000	1.5.2.2
  @@ -5,13 +5,20 @@
   <XDtMerge:merge file="xdoclet/modules/ojb/resources/intermediate-representation.xdt"></XDtMerge:merge>
   <XDtOjb:createTorqueSchema/>
   <database name="<XDtConfig:configParameterValue paramName='databaseName'/>"><XDtOjb:forAllTables>
  -    <XDtOjb:ifHasProperty level="table" name="documentation">
  +    <XDtOjb:ifHasProperty level="table" name="table-documentation">
       <table name="<XDtOjb:name level='table'/>"
  -           description="<XDtOjb:propertyValue level='table' name='documentation'/>"
  +           description="<XDtOjb:propertyValue level='table' name='table-documentation'/>"
       >
       </XDtOjb:ifHasProperty>
  -    <XDtOjb:ifDoesntHaveProperty level="table" name="documentation">
  +    <XDtOjb:ifDoesntHaveProperty level="table" name="table-documentation">
  +        <XDtOjb:ifHasProperty level="table" name="documentation">
  +    <table name="<XDtOjb:name level='table'/>"
  +           description="<XDtOjb:propertyValue level='table' name='documentation'/>"
  +    >
  +        </XDtOjb:ifHasProperty>
  +        <XDtOjb:ifDoesntHaveProperty level="table" name="documentation">
       <table name="<XDtOjb:name level='table'/>">
  +        </XDtOjb:ifDoesntHaveProperty>
       </XDtOjb:ifDoesntHaveProperty>
           <XDtOjb:forAllColumns>
           <column name="<XDtOjb:name level='column'/>"
  @@ -34,9 +41,14 @@
                   <XDtOjb:ifHasProperty level="column" name="size">
                   size="<XDtOjb:propertyValue level='column' name='size'/>"
                   </XDtOjb:ifHasProperty>
  -                <XDtOjb:ifHasProperty level="column" name="documentation">
  -                description="<XDtOjb:propertyValue level='column' name='documentation'/>"
  +                <XDtOjb:ifHasProperty level="column" name="column-documentation">
  +                description="<XDtOjb:propertyValue level='column' name='column-documentation'/>"
                   </XDtOjb:ifHasProperty>
  +                <XDtOjb:ifDoesntHaveProperty level="column" name="column-documentation">
  +                    <XDtOjb:ifHasProperty level="column" name="documentation">
  +                description="<XDtOjb:propertyValue level='column' name='documentation'/>"
  +                    </XDtOjb:ifHasProperty>
  +                </XDtOjb:ifDoesntHaveProperty>
           />
           </XDtOjb:forAllColumns>
           <XDtConfig:ifConfigParamEquals paramName="generateForeignkeys" value="true">
  
  
  
  No                   revision
  No                   revision
  1.13.2.4  +22 -20    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.3
  retrieving revision 1.13.2.4
  diff -u -r1.13.2.3 -r1.13.2.4
  --- OjbTagsHandler.java	2 Mar 2005 22:44:13 -0000	1.13.2.3
  +++ OjbTagsHandler.java	6 Mar 2005 18:53:33 -0000	1.13.2.4
  @@ -136,6 +136,7 @@
        * @doc.param                   name="row-reader" optional="true" description="The
row reader for the class"
        * @doc.param                   name="schema" optional="true" description="The schema
for the type"
        * @doc.param                   name="table" optional="true" description="The table
for the class"
  +     * @doc.param                   name="table-documentation" optional="true" description="Documentation
on the table"
        */
       public void processClass(String template, Properties attributes) throws XDocletException
       {
  @@ -708,38 +709,39 @@
        * @param attributes            The attributes of the tag
        * @exception XDocletException  if an error occurs
        * @doc.tag                     type="block"
  +     * @doc.param                   name="access" optional="true" description="The accessibility
of the column" values="readonly,readwrite"
  +     * @doc.param                   name="attributes" optional="true" description="Attributes
of the field as name-value pairs 'name=value',
  +     *      separated by commas"
  +     * @doc.param                   name="autoincrement" optional="true" description="Whether
the field is
  +     *      auto-incremented" values="none,ojb,database"
  +     * @doc.param                   name="column" optional="true" description="The column
for the field"
  +     * @doc.param                   name="column-documentation" optional="true" description="Documentation
on the column"
  +     * @doc.param                   name="conversion" optional="true" description="The
fully qualified name of the
  +     *      conversion for the field"
  +     * @doc.param                   name="default-fetch" optional="true" description="The
default-fetch setting"
  +     *      values="true,false"
  +     * @doc.param                   name="documentation" optional="true" description="Documentation
on the field"
        * @doc.param                   name="id" optional="true" description="The position
of the field in the class
        *      descriptor"
  -     * @doc.param                   name="table" optional="true" description="The table
of the field (not implemented
  -     *      yet)"
  -     * @doc.param                   name="column" optional="true" description="The column
for the field"
  +     * @doc.param                   name="indexed" optional="true" description="Whether
the field is indexed"
  +     *      values="true,false"
        * @doc.param                   name="jdbc-type" optional="true" description="The jdbc
type of the column"
  -     * @doc.param                   name="primarykey" optional="true" description="Whether
the field is a primarykey"
  +     * @doc.param                   name="length" optional="true" description="The length
of the column"
  +     * @doc.param                   name="locking" optional="true" description="Whether
the field supports locking"
        *      values="true,false"
        * @doc.param                   name="nullable" optional="true" description="Whether
the field is nullable"
        *      values="true,false"
  -     * @doc.param                   name="indexed" optional="true" description="Whether
the field is indexed"
  +     * @doc.param                   name="precision" optional="true" description="The precision
of the column"
  +     * @doc.param                   name="primarykey" optional="true" description="Whether
the field is a primarykey"
        *      values="true,false"
  -     * @doc.param                   name="autoincrement" optional="true" description="Whether
the field is
  -     *      auto-incremented" values="none,ojb,database"
  +     * @doc.param                   name="scale" optional="true" description="The scale
of the column"
        * @doc.param                   name="sequence-name" optional="true" description="The
name of the sequence for
        *      incrementing the field"
  -     * @doc.param                   name="locking" optional="true" description="Whether
the field supports locking"
  -     *      values="true,false"
  +     * @doc.param                   name="table" optional="true" description="The table
of the field (not implemented
  +     *      yet)"
        * @doc.param                   name="update-lock" optional="true" description="Can
be set to false if the persistent attribute is
        *      used for optimistic locking AND the dbms should update the lock column itself
(default is true). Can only be set for
        *      TIMESTAMP and INTEGER columns" values="true,false"
  -     * @doc.param                   name="default-fetch" optional="true" description="The
default-fetch setting"
  -     *      values="true,false"
  -     * @doc.param                   name="conversion" optional="true" description="The
fully qualified name of the
  -     *      conversion for the field"
  -     * @doc.param                   name="length" optional="true" description="The length
of the column"
  -     * @doc.param                   name="precision" optional="true" description="The precision
of the column"
  -     * @doc.param                   name="scale" optional="true" description="The scale
of the column"
  -     * @doc.param                   name="access" optional="true" description="The accessibility
of the column" values="readonly,readwrite"
  -     * @doc.param                   name="documentation" optional="true" description="Documentation
on the field"
  -     * @doc.param                   name="attributes" optional="true" description="Attributes
of the field as name-value pairs 'name=value',
  -     *      separated by commas"
        */
       public void processField(String template, Properties attributes) throws XDocletException
       {
  
  
  

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