empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franci...@apache.org
Subject svn commit: r1234905 - /incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Table.vm
Date Mon, 23 Jan 2012 17:12:39 GMT
Author: francisdb
Date: Mon Jan 23 17:12:39 2012
New Revision: 1234905

URL: http://svn.apache.org/viewvc?rev=1234905&view=rev
Log:
EMPIREDB-128 Velocity Template Table.vm does not handle tables without primary keys
patch by Christian Albrecht

Modified:
    incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Table.vm

Modified: incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Table.vm
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Table.vm?rev=1234905&r1=1234904&r2=1234905&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Table.vm (original)
+++ incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Table.vm Mon
Jan 23 17:12:39 2012
@@ -46,19 +46,21 @@ public class $parser.getTableClassName($
 #end
 
 		// configure key columns (primary key)
+#if($table.keyColumns.size()>0)
 #if($table.keyColumns.size()==1)
 		setPrimaryKey(${parser.getColumnName($table.keyColumns[0])});
 #else
 		DBTableColumn[] keyColumns = new DBTableColumn[] {
 #foreach ($col in $table.keyColumns)
 #if($foreach.isLast()==false)
-    		${parser.getColumnName($col)},
+			${parser.getColumnName($col)},
 #else
-    		${parser.getColumnName($col)} };
+			${parser.getColumnName($col)} };
 		setPrimaryKey(keyColumns);
-#end    	
 #end
-		
+#end
+#end
+
 		// Optimistic locking column
 #if($parser.hasLockingColumn($table) == true)
 		setTimestampColumn(${parser.getColumnName($table.getTimestampColumn())});



Mime
View raw message