empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e.@apache.org
Subject svn commit: r1181643 - /incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleApp.java
Date Tue, 11 Oct 2011 07:28:48 GMT
Author: ek
Date: Tue Oct 11 07:28:47 2011
New Revision: 1181643

URL: http://svn.apache.org/viewvc?rev=1181643&view=rev
Log:
fixing query in example-basic for postgresql

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

Modified: incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleApp.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleApp.java?rev=1181643&r1=1181642&r2=1181643&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleApp.java
(original)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleApp.java
Tue Oct 11 07:28:47 2011
@@ -374,18 +374,12 @@ public class SampleApp 
         DBColumnExpr PHONE_EXT_NUMBER = EMP.PHONE_NUMBER.substring(PHONE_LAST_DASH).as("PHONE_EXTENSION");
         
         // DBColumnExpr genderExpr = cmd.select(EMP.GENDER.decode(EMP.GENDER.getOptions()).as(EMP.GENDER.getName()));
-		// Select required columns
-		cmd.select(EMP.EMPLOYEE_ID, EMPLOYEE_FULLNAME);
-		if(db.getDriver() instanceof DBDatabaseDriverPostgreSQL)
-		{	// postgres does not support the substring expression
-			cmd.select(EMP.GENDER, EMP.PHONE_NUMBER);
-		}else{
-			cmd.select(EMP.GENDER, EMP.PHONE_NUMBER, PHONE_EXT_NUMBER);
-			
-		}
-		cmd.select(DEP.NAME.as("DEPARTMENT"));
-		cmd.select(DEP.BUSINESS_UNIT);
-		cmd.join(EMP.DEPARTMENT_ID, DEP.DEPARTMENT_ID);
+        // Select required columns
+        cmd.select(EMP.EMPLOYEE_ID, EMPLOYEE_FULLNAME);
+        cmd.select(EMP.GENDER, EMP.PHONE_NUMBER, PHONE_EXT_NUMBER);
+        cmd.select(DEP.NAME.as("DEPARTMENT"));
+        cmd.select(DEP.BUSINESS_UNIT);
+        cmd.join(EMP.DEPARTMENT_ID, DEP.DEPARTMENT_ID);
         // Set constraints and order
         cmd.where(EMP.LASTNAME.length().isGreaterThan(0));
         cmd.orderBy(EMP.LASTNAME, EMP.FIRSTNAME);



Mime
View raw message