You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by th...@apache.org on 2002/09/23 18:55:18 UTC
cvs commit: jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/builder AxionBuilder.java
thorhauer 2002/09/23 09:55:18
Modified: sql/src/java/org/apache/commons/sql/builder
AxionBuilder.java
Log:
adding support for default column values and making table and column protected
so that they can be accessed in subclasses that need to override methods like
createColumn
Revision Changes Path
1.3 +24 -0 jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/builder/AxionBuilder.java
Index: AxionBuilder.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/builder/AxionBuilder.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AxionBuilder.java 12 Sep 2002 17:56:49 -0000 1.2
+++ AxionBuilder.java 23 Sep 2002 16:55:18 -0000 1.3
@@ -103,4 +103,28 @@
protected void printNotNullable() throws IOException {
//print("NOT NULL");
}
+
+ /**
+ * Outputs the DDL to add a column to a table. Axion
+ * does not support default values so we are removing
+ * default from the Axion column builder.
+ */
+ public void createColumn(Column column) throws IOException {
+ this.column = column;
+ print(column.getName());
+ print(" ");
+ print(getSqlType(column));
+ print(" ");
+
+ if (column.isRequired()) {
+ printNotNullable();
+ }
+ else {
+ printNullable();
+ }
+ print(" ");
+ if (column.isAutoIncrement()) {
+ printAutoIncrementColumn();
+ }
+ }
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>