empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1626157 - /empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleDB.java
Date Fri, 19 Sep 2014 09:22:39 GMT
Author: doebele
Date: Fri Sep 19 09:22:38 2014
New Revision: 1626157

URL: http://svn.apache.org/r1626157
Log:
EMPIREDB-208

Modified:
    empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleDB.java

Modified: empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleDB.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleDB.java?rev=1626157&r1=1626156&r2=1626157&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleDB.java
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleDB.java
Fri Sep 19 09:22:38 2014
@@ -68,11 +68,11 @@ public class SampleDB extends DBDatabase
         {
             super("DEPARTMENTS", db);
             // ID
-            DEPARTMENT_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.AutoGenerated);
+            DEPARTMENT_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);
 
             // Primary Key
             setPrimaryKey(DEPARTMENT_ID);
@@ -107,18 +107,18 @@ public class SampleDB extends DBDatabase
         {
             super("EMPLOYEES", db);
             // ID
-            EMPLOYEE_ID     = addColumn("EMPLOYEE_ID",      DataType.AUTOINC,      0, DataMode.AutoGenerated,
"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("DEPARTMENT_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.AutoGenerated);
+            EMPLOYEE_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("DEPARTMENT_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);
 
             // Primary Key
             setPrimaryKey(EMPLOYEE_ID);
@@ -126,7 +126,7 @@ public class SampleDB extends DBDatabase
             addIndex("EMPLOYEE_NAME_IDX", true, new DBColumn[] { FIRSTNAME, LASTNAME, DATE_OF_BIRTH
});
             // Set timestamp column for save updates
             setTimestampColumn(UPDATE_TIMESTAMP);
-
+            
             // Create Options for GENDER column
             Options genders = new Options();
             genders.set(Gender.M, "Male");



Mime
View raw message