commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thorha...@apache.org
Subject cvs commit: jakarta-commons-sandbox/sql/src/test-input datamodel.xml
Date Mon, 23 Sep 2002 16:57:27 GMT
thorhauer    2002/09/23 09:57:27

  Modified:    sql/src/java/org/apache/commons/sql/model Column.java
               sql/src/jelly createSql.jelly
               sql/src/schema database.xsd
               sql/src/test/org/apache/commons/sql/model TestColumn.java
               sql/src/test-input datamodel.xml
  Log:
  adding support for default column values
  
  Revision  Changes    Path
  1.4       +14 -1     jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/model/Column.java
  
  Index: Column.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/model/Column.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Column.java	16 Sep 2002 14:51:08 -0000	1.3
  +++ Column.java	23 Sep 2002 16:57:26 -0000	1.4
  @@ -73,12 +73,14 @@
       private boolean autoIncrement = false;
       private String type;
       private int size = 0;
  +    private String defaultValue;
       
       public Column() 
       {
       }
   
  -    public Column(String name, String type, int size, boolean required, boolean primaryKey,
boolean autoIncrement) 
  +    public Column(String name, String type, int size, boolean required, boolean 
  +                  primaryKey, boolean autoIncrement, String defaultValue) 
       {
           this.name = name;
           this.type = type;
  @@ -86,6 +88,7 @@
           this.required = required;
           this.primaryKey = primaryKey;
           this.autoIncrement = autoIncrement;
  +        this.defaultValue = defaultValue;
       }
   
       public String toString() 
  @@ -153,6 +156,16 @@
           this.size = size;
       }
       
  +    public String getDefaultValue()
  +    {
  +        return defaultValue;
  +    }
  +    
  +    public void setDefaultValue(String defaultValue)
  +    {
  +        this.defaultValue = defaultValue;
  +    }
  +
       // Helper methods
       //-------------------------------------------------------------------------       
        
       
  
  
  
  1.3       +1 -1      jakarta-commons-sandbox/sql/src/jelly/createSql.jelly
  
  Index: createSql.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/sql/src/jelly/createSql.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- createSql.jelly	9 Sep 2002 13:47:57 -0000	1.2
  +++ createSql.jelly	23 Sep 2002 16:57:26 -0000	1.3
  @@ -12,7 +12,7 @@
   <b:parse var="database" 
     uri="../test-input/datamodel.xml" 
     introspector="${introspector}"
  -  rootClass="org.apache.commons.sql.datamodel.Database"/>
  +  rootClass="org.apache.commons.sql.model.Database"/>
   
   Creating file: target/sql.xml
   
  
  
  
  1.2       +1 -0      jakarta-commons-sandbox/sql/src/schema/database.xsd
  
  Index: database.xsd
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/sql/src/schema/database.xsd,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- database.xsd	31 Jul 2002 17:00:03 -0000	1.1
  +++ database.xsd	23 Sep 2002 16:57:26 -0000	1.2
  @@ -101,6 +101,7 @@
           </xsd:simpleType>
         </xsd:attribute>
         <xsd:attribute name="size" use="optional" type="xsd:string"/>
  +      <xsd:attribute name="defaultValue" use="optional" type="xsd:string"/>
         <xsd:attribute name="description" use="optional" type="xsd:string"/>
       </xsd:complexType>
     </xsd:element>
  
  
  
  1.2       +3 -3      jakarta-commons-sandbox/sql/src/test/org/apache/commons/sql/model/TestColumn.java
  
  Index: TestColumn.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/sql/src/test/org/apache/commons/sql/model/TestColumn.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestColumn.java	20 Sep 2002 21:28:00 -0000	1.1
  +++ TestColumn.java	23 Sep 2002 16:57:26 -0000	1.2
  @@ -64,7 +64,7 @@
       public void testColumn()
           throws Exception
       {
  -        Column column = new Column("Test1","INTEGER",255,true,true,true);
  +        Column column = new Column("Test1","INTEGER",255,true,true,true,"");
           assertTrue("Column is null", column != null);
           assertTrue("Column toString does not end with [name=Test1;type=INTEGER]", 
                  ((String)column.toString()).endsWith("[name=Test1;type=INTEGER]"));
  
  
  
  1.5       +1 -1      jakarta-commons-sandbox/sql/src/test-input/datamodel.xml
  
  Index: datamodel.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/sql/src/test-input/datamodel.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- datamodel.xml	20 Sep 2002 20:34:38 -0000	1.4
  +++ datamodel.xml	23 Sep 2002 16:57:27 -0000	1.5
  @@ -19,7 +19,7 @@
       <column name="book_id" type="INTEGER" required="true" primaryKey="true" autoIncrement="true"/>
       <column name="isbn" type="VARCHAR" size="15" required="true"/>
       <column name="author_id" type="INTEGER" required="true"/>
  -    <column name="title" type="VARCHAR" size="255" required="true"/>
  +    <column name="title" type="VARCHAR" size="255" defaultValue="N/A" required="true"/>
   	    
       <foreign-key foreignTable="author">
       <reference local="author_id" foreign="author_id"/>
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message