You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by to...@apache.org on 2004/05/07 01:23:39 UTC
cvs commit: db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/resources torque_xml.xdt
tomdz 2004/05/06 16:23:39
Modified: src/xdoclet/java/src/xdoclet/modules/ojb/model
TorqueModelDef.java
src/xdoclet/test/xdoclet/modules/ojb/tests
ModifyInheritedTagDocumentationAttributeTests.java
ClassTagDocumentationAttributeTests.java
FieldTagDocumentationAttributeTests.java
lib xdoclet-ojb-module-1.2.jar
src/xdoclet/java/src/xdoclet/modules/ojb/resources
torque_xml.xdt
Log:
The xdoclet module now also uses the documentation attribute of ojb.class and ojb.field for generating the description attribute of the table and column tags in the torque schema
Revision Changes Path
1.6 +10 -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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TorqueModelDef.java 5 Apr 2004 00:32:31 -0000 1.5
+++ TorqueModelDef.java 6 May 2004 23:23:38 -0000 1.6
@@ -78,6 +78,11 @@
{
tableDef = new TableDef(name);
addTable(tableDef);
+ if (classDef.hasProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION))
+ {
+ tableDef.setProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION,
+ classDef.getProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION));
+ }
}
for (Iterator fieldIt = classDef.getFields(); fieldIt.hasNext();)
{
@@ -159,6 +164,11 @@
columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_AUTOINCREMENT, "true");
}
columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_SIZE, fieldDef.getSizeConstraint());
+ if (fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION))
+ {
+ columnDef.setProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION,
+ fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_DOCUMENTATION));
+ }
return columnDef;
}
1.4 +3 -0 db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/ModifyInheritedTagDocumentationAttributeTests.java
Index: ModifyInheritedTagDocumentationAttributeTests.java
===================================================================
RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/ModifyInheritedTagDocumentationAttributeTests.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ModifyInheritedTagDocumentationAttributeTests.java 5 Apr 2004 12:16:16 -0000 1.3
+++ ModifyInheritedTagDocumentationAttributeTests.java 6 May 2004 23:23:38 -0000 1.4
@@ -85,6 +85,7 @@
" <column name=\"attr\"\n"+
" javaName=\"attr\"\n"+
" type=\"INTEGER\"\n"+
+ " description=\"Some documentation\"\n"+
" />\n"+
" </table>\n"+
"</database>",
@@ -448,6 +449,7 @@
" <column name=\"attr\"\n"+
" javaName=\"attr\"\n"+
" type=\"INTEGER\"\n"+
+ " description=\"Some documentation\"\n"+
" />\n"+
" </table>\n"+
"</database>",
@@ -506,6 +508,7 @@
" <column name=\"attr\"\n"+
" javaName=\"attr\"\n"+
" type=\"INTEGER\"\n"+
+ " description=\"Some documentation\"\n"+
" />\n"+
" </table>\n"+
" <table name=\"B\">\n"+
1.3 +2 -2 db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/ClassTagDocumentationAttributeTests.java
Index: ClassTagDocumentationAttributeTests.java
===================================================================
RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/ClassTagDocumentationAttributeTests.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ClassTagDocumentationAttributeTests.java 5 Apr 2004 12:16:16 -0000 1.2
+++ ClassTagDocumentationAttributeTests.java 6 May 2004 23:23:38 -0000 1.3
@@ -68,7 +68,7 @@
runOjbXDoclet(OJB_DEST_FILE));
assertEqualsTorqueSchemaFile(
"<database name=\"ojbtest\">\n"+
- " <table name=\"A\">\n"+
+ " <table name=\"A\" description=\"some documentation\">\n"+
" </table>\n"+
"</database>",
runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest"));
@@ -102,7 +102,7 @@
runOjbXDoclet(OJB_DEST_FILE));
assertEqualsTorqueSchemaFile(
"<database name=\"ojbtest\">\n"+
- " <table name=\"A\">\n"+
+ " <table name=\"A\" description=\"some documentation\">\n"+
" </table>\n"+
" <table name=\"B\">\n"+
" </table>\n"+
1.3 +3 -0 db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/FieldTagDocumentationAttributeTests.java
Index: FieldTagDocumentationAttributeTests.java
===================================================================
RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/FieldTagDocumentationAttributeTests.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FieldTagDocumentationAttributeTests.java 5 Apr 2004 12:16:16 -0000 1.2
+++ FieldTagDocumentationAttributeTests.java 6 May 2004 23:23:38 -0000 1.3
@@ -96,6 +96,7 @@
" <column name=\"attr\"\n"+
" javaName=\"attr\"\n"+
" type=\"INTEGER\"\n"+
+ " description=\"Some documentation\""+
" />\n"+
" </table>\n"+
"</database>",
@@ -152,12 +153,14 @@
" <column name=\"attr\"\n"+
" javaName=\"attr\"\n"+
" type=\"INTEGER\"\n"+
+ " description=\"Some documentation\""+
" />\n"+
" </table>\n"+
" <table name=\"B\">\n"+
" <column name=\"attr\"\n"+
" javaName=\"attr\"\n"+
" type=\"INTEGER\"\n"+
+ " description=\"Some documentation\""+
" />\n"+
" </table>\n"+
"</database>",
1.11 +120 -118 db-ojb/lib/xdoclet-ojb-module-1.2.jar
<<Binary file>>
1.5 +4 -1 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- torque_xml.xdt 25 Jan 2004 12:47:33 -0000 1.4
+++ torque_xml.xdt 6 May 2004 23:23:38 -0000 1.5
@@ -5,7 +5,7 @@
<XDtMerge:merge file="xdoclet/modules/ojb/resources/intermediate-representation.xdt"></XDtMerge:merge>
<XDtOjb:createTorqueSchema/>
<database name="<XDtConfig:configParameterValue paramName='databaseName'/>"><XDtOjb:forAllTables>
- <table name="<XDtOjb:name level='table'/>">
+ <table name="<XDtOjb:name level='table'/>"<XDtOjb:ifHasProperty level="table" name="documentation"> description="<XDtOjb:propertyValue level='table' name='documentation'/>"</XDtOjb:ifHasProperty>>
<XDtOjb:forAllColumns>
<column name="<XDtOjb:name level='column'/>"
<XDtOjb:ifHasProperty level="column" name="javaName">
@@ -26,6 +26,9 @@
</XDtOjb:ifHasProperty>
<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>
/>
</XDtOjb:forAllColumns>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org