You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by mp...@apache.org on 2001/12/19 00:25:06 UTC
cvs commit: jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model Column.java Table.java
mpoeschl 01/12/18 15:25:06
Modified: src/dtd database.dtd
src/java/org/apache/torque/engine/database/model Column.java
Table.java
Log:
add 'description' attribute to <table> and <column>
Revision Changes Path
1.8 +27 -25 jakarta-turbine-torque/src/dtd/database.dtd
Index: database.dtd
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/dtd/database.dtd,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- database.dtd 2001/12/13 16:58:07 1.7
+++ database.dtd 2001/12/18 23:25:06 1.8
@@ -1,6 +1,6 @@
-<!--
- Torque XML database schema DTD
- $Id: database.dtd,v 1.7 2001/12/13 16:58:07 jmcnally Exp $
+<!--
+ Torque XML database schema DTD
+ $Id: database.dtd,v 1.8 2001/12/18 23:25:06 mpoeschl Exp $
-->
<!--
@@ -16,19 +16,19 @@
agnostic way.
-->
-<!--
+<!--
defaultJavaNamingMethod determines how a table or column name,
from the name attribute in the xml database file, is converted to a
Java class or method name.
- nochange - indicates not change is performed.
- underscore - Underscores are removed, First letter is
- capitalized, first letter after an underscore
- is capitalized, the rest of the letters are
- converted to lowercase.
- javaname - same as underscore, but no letters are converted
- to lowercase.
+ nochange - indicates not change is performed.
+ underscore - Underscores are removed, First letter is
+ capitalized, first letter after an underscore
+ is capitalized, the rest of the letters are
+ converted to lowercase.
+ javaname - same as underscore, but no letters are converted
+ to lowercase.
-->
<!ELEMENT database (table+)>
@@ -43,7 +43,7 @@
>
<!ELEMENT table (column+,(foreign-key|index|unique|id-method-parameter)*)>
-<!ATTLIST table
+<!ATTLIST table
name CDATA #REQUIRED
javaName CDATA #IMPLIED
idMethod (idbroker|native|autoincrement|sequence|none|null) "null"
@@ -54,16 +54,17 @@
alias CDATA #IMPLIED
javaNamingMethod (nochange|underscore|javaname) #IMPLIED
skipHeavyIndexing (true|false) "false"
+ description CDATA #IMPLIED
>
<!ELEMENT id-method-parameter EMPTY>
<!ATTLIST id-method-parameter
- name CDATA "default"
+ name CDATA "default"
value CDATA #REQUIRED
>
-
+
<!ELEMENT column (inheritance*)>
-<!ATTLIST column
+<!ATTLIST column
name CDATA #REQUIRED
javaName CDATA #IMPLIED
primaryKey (true|false) "false"
@@ -76,38 +77,39 @@
| NULL | OTHER | JAVA_OBJECT | DISTINCT | STRUCT | ARRAY
| BLOB | CLOB | REF | BOOLEANINT | BOOLEANCHAR
| DOUBLE
- ) "VARCHAR"
+ ) "VARCHAR"
size CDATA #IMPLIED
default CDATA #IMPLIED
autoIncrement (true|false) "false"
- inheritance (single|false) "false"
+ inheritance (single|false) "false"
inputValidator CDATA #IMPLIED
javaNamingMethod (nochange|underscore|javaname) #IMPLIED
+ description CDATA #IMPLIED
>
<!ELEMENT inheritance EMPTY>
<!ATTLIST inheritance
- key CDATA #REQUIRED
+ key CDATA #REQUIRED
class CDATA #REQUIRED
extends CDATA #IMPLIED
>
-
+
<!ELEMENT foreign-key (reference+)>
-<!ATTLIST foreign-key
+<!ATTLIST foreign-key
foreignTable CDATA #REQUIRED
name CDATA #IMPLIED
- onUpdate (cascade|setnull|restrict|none) "none"
- onDelete (cascade|setnull|restrict|none) "none"
+ onUpdate (cascade|setnull|restrict|none) "none"
+ onDelete (cascade|setnull|restrict|none) "none"
>
-
+
<!ELEMENT reference EMPTY>
-<!ATTLIST reference
+<!ATTLIST reference
local CDATA #REQUIRED
foreign CDATA #REQUIRED
>
<!ELEMENT index (index-column+)>
-<!ATTLIST index
+<!ATTLIST index
name CDATA #IMPLIED
>
1.16 +20 -1 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Column.java
Index: Column.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Column.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Column.java 2001/11/08 17:20:52 1.15
+++ Column.java 2001/12/18 23:25:06 1.16
@@ -71,11 +71,12 @@
* @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
* @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
* @author <a href="mailto:byron_foster@byron_foster@yahoo.com>Byron Foster</a>
- * @version $Id: Column.java,v 1.15 2001/11/08 17:20:52 mpoeschl Exp $
+ * @version $Id: Column.java,v 1.16 2001/12/18 23:25:06 mpoeschl Exp $
*/
public class Column
{
private String name;
+ private String description;
private String javaName = null;
private String javaNamingMethod;
private boolean isNotNull = false;
@@ -196,6 +197,7 @@
( inheritanceType != null && !inheritanceType.equals("false") );
this.inputValidator = attrib.getValue("inputValidator");
+ description = attrib.getValue("description");
}
/**
@@ -222,6 +224,23 @@
name = newName;
}
+ /**
+ * Get the description for the Table
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * Set the description for the Table
+ *
+ * @param newDescription description for the Table
+ */
+ public void setDescription(String newDescription)
+ {
+ description = newDescription;
+ }
/**
* Get name to use in Java sources
1.20 +26 -5 jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Table.java
Index: Table.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Table.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Table.java 2001/12/13 16:58:07 1.19
+++ Table.java 2001/12/18 23:25:06 1.20
@@ -75,7 +75,7 @@
* @author <a href="mailto:jmcnally@collab.net>John McNally</a>
* @author <a href="mailto:dlr@collab.net>Daniel Rall</a>
* @author <a href="mailto:byron_foster@byron_foster@yahoo.com>Byron Foster</a>
- * @version $Id: Table.java,v 1.19 2001/12/13 16:58:07 jmcnally Exp $
+ * @version $Id: Table.java,v 1.20 2001/12/18 23:25:06 mpoeschl Exp $
*/
public class Table implements IDMethod
{
@@ -88,6 +88,7 @@
private List unices;
private List idMethodParameters;
private String name;
+ private String description;
private String javaName;
private String idMethod;
private String javaNamingMethod;
@@ -107,6 +108,7 @@
private boolean needsTransactionInPostgres;
private boolean skipHeavyIndexing;
+
/**
* Default Constructor
*/
@@ -167,6 +169,7 @@
alias = attrib.getValue("alias");
skipHeavyIndexing = "true"
.equals(attrib.getValue("skipHeavyIndexing"));
+ description = attrib.getValue("description");
}
/**
@@ -181,11 +184,11 @@
{
// Heavy indexing must wait until after all columns composing
// a table's primary key have been parsed.
- if (!skipHeavyIndexing && !getDatabase().isSkipHeavyIndexing())
+ if (!skipHeavyIndexing && !getDatabase().isSkipHeavyIndexing())
{
- doHeavyIndexing();
+ doHeavyIndexing();
}
-
+
// Name any indices which are missing a name using the
// appropriate algorithm.
doNaming();
@@ -587,6 +590,24 @@
}
/**
+ * Get the description for the Table
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * Set the description for the Table
+ *
+ * @param newDescription description for the Table
+ */
+ public void setDescription(String newDescription)
+ {
+ description = newDescription;
+ }
+
+ /**
* Get name to use in Java sources
*/
public String getJavaName()
@@ -1001,7 +1022,7 @@
public boolean hasPrimaryKey()
{
return (getPrimaryKey().size() > 0);
- }
+ }
/**
* Returns all parts of the primary key, separated by commas.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>