empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r903490 [2/2] - in /incubator/empire-db/trunk: empire-db-examples/empire-db-example-advanced/src/main/java/org/apache/empire/samples/db/advanced/ empire-db-examples/empire-db-example-basic/ empire-db-examples/empire-db-example-basic/src/mai...
Date Tue, 26 Jan 2010 23:34:17 GMT
Modified: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/CompanyDB.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/CompanyDB.java?rev=903490&r1=903489&r2=903490&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/CompanyDB.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/CompanyDB.java
Tue Jan 26 23:34:14 2010
@@ -20,6 +20,7 @@
 
 import org.apache.empire.commons.Options;
 import org.apache.empire.data.DataType;
+import org.apache.empire.data.DataMode;
 import org.apache.empire.db.DBColumn;
 import org.apache.empire.db.DBDatabase;
 import org.apache.empire.db.DBTable;
@@ -47,11 +48,11 @@
         {
             super("DEPARTMENTS", db);
             // ID
-            ID   = addColumn("DEPARTMENT_ID",    DataType.AUTOINC,       0, true, "DEP_ID_SEQUENCE");
-            NAME            = addColumn("NAME",             DataType.TEXT,         80, true);
-            HEAD            = addColumn("HEAD",             DataType.TEXT,         80, false);
-            BUSINESS_UNIT   = addColumn("BUSINESS_UNIT",    DataType.TEXT,          4, true,
"ITTK");
-            UPDATE_TIMESTAMP= addColumn("UPDATE_TIMESTAMP", DataType.DATETIME,      0, true);
+            ID              = addColumn("DEPARTMENT_ID",    DataType.AUTOINC,       0, DataMode.AutoGenerated,
"DEP_ID_SEQUENCE");
+            NAME            = addColumn("NAME",             DataType.TEXT,         80, DataMode.NotNull);
+            HEAD            = addColumn("HEAD",             DataType.TEXT,         80, DataMode.Nullable);
+            BUSINESS_UNIT   = addColumn("BUSINESS_UNIT",    DataType.TEXT,          4, DataMode.NotNull,
"ITTK");
+            UPDATE_TIMESTAMP= addColumn("UPDATE_TIMESTAMP", DataType.DATETIME,      0, DataMode.NotNull);
 
             // Primary Key
             setPrimaryKey(ID);
@@ -84,18 +85,18 @@
         {
             super("EMPLOYEES", db);
             // ID
-            ID     = addColumn("EMPLOYEE_ID",      DataType.AUTOINC,      0, true, "EMPLOYEE_ID_SEQUENCE");
-            SALUTATION      = addColumn("SALUTATION",       DataType.TEXT,        20, false);
-            FIRSTNAME       = addColumn("FIRSTNAME",        DataType.TEXT,        40, true);
-            LASTNAME        = addColumn("LASTNAME",         DataType.TEXT,        40, true);
-            DATE_OF_BIRTH   = addColumn("DATE_OF_BIRTH",    DataType.DATE,         0, false);
-            DEPARTMENT_ID   = addColumn("ID",    DataType.INTEGER,      0, true);
-            GENDER          = addColumn("GENDER",           DataType.TEXT,         1, false);
-            PHONE_NUMBER    = addColumn("PHONE_NUMBER",     DataType.TEXT,        40, false);
-            EMAIL           = addColumn("EMAIL",            DataType.TEXT,        80, false);
-            SALARY          = addColumn("SALARY",           DataType.DECIMAL,   10.2, false);
-            RETIRED         = addColumn("RETIRED",          DataType.BOOL,         0, true,
false);
-            UPDATE_TIMESTAMP= addColumn("UPDATE_TIMESTAMP", DataType.DATETIME,     0, true);
+            ID              = addColumn("EMPLOYEE_ID",      DataType.AUTOINC,      0, DataMode.NotNull,
"EMPLOYEE_ID_SEQUENCE");
+            SALUTATION      = addColumn("SALUTATION",       DataType.TEXT,        20, DataMode.Nullable);
+            FIRSTNAME       = addColumn("FIRSTNAME",        DataType.TEXT,        40, DataMode.NotNull);
+            LASTNAME        = addColumn("LASTNAME",         DataType.TEXT,        40, DataMode.NotNull);
+            DATE_OF_BIRTH   = addColumn("DATE_OF_BIRTH",    DataType.DATE,         0, DataMode.Nullable);
+            DEPARTMENT_ID   = addColumn("ID",               DataType.INTEGER,      0, DataMode.NotNull);
+            GENDER          = addColumn("GENDER",           DataType.TEXT,         1, DataMode.Nullable);
+            PHONE_NUMBER    = addColumn("PHONE_NUMBER",     DataType.TEXT,        40, DataMode.Nullable);
+            EMAIL           = addColumn("EMAIL",            DataType.TEXT,        80, DataMode.Nullable);
+            SALARY          = addColumn("SALARY",           DataType.DECIMAL,   10.2, DataMode.Nullable);
+            RETIRED         = addColumn("RETIRED",          DataType.BOOL,         0, DataMode.NotNull,
false);
+            UPDATE_TIMESTAMP= addColumn("UPDATE_TIMESTAMP", DataType.DATETIME,     0, DataMode.NotNull);
 
             // Primary Key
             setPrimaryKey(ID);
@@ -119,7 +120,7 @@
     /**
      * Constructor of the CompanyDB data model description
      *
-     * Put all foreigen key realtions here.
+     * Put all foreign key relations here.
      */
     public CompanyDB()
     {

Modified: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/DBCommandTest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/DBCommandTest.java?rev=903490&r1=903489&r2=903490&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/DBCommandTest.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/DBCommandTest.java
Tue Jan 26 23:34:14 2010
@@ -100,6 +100,12 @@
         }
 
         @Override
+        public boolean isAutoGenerated()
+        {
+            return false;
+        }
+
+        @Override
         public boolean isRequired()
         {
             return false;



Mime
View raw message