You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by be...@apache.org on 2011/07/02 18:23:04 UTC

svn commit: r1142243 - /incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Database.vm

Author: benniven
Date: Sat Jul  2 16:23:03 2011
New Revision: 1142243

URL: http://svn.apache.org/viewvc?rev=1142243&view=rev
Log:
This commit is for EMPIREDB-110:
- extended the database velocity template to generate the appropriate lines for table relations

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

Modified: incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Database.vm
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Database.vm?rev=1142243&r1=1142242&r2=1142243&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Database.vm (original)
+++ incubator/empire-db/trunk/empire-db-codegen/src/main/resources/templates/Database.vm Sat Jul  2 16:23:03 2011
@@ -68,6 +68,11 @@ public class $dbClassName extends DBData
 	 * Default constructor for the $dbClassName.
 	 */
 	private ${dbClassName}() {
+#foreach ($relation in $database.relations)
+#foreach ($reference in $relation.references)
+		addRelation(${reference.sourceColumn.rowSet.name}.${parser.getAttributeName($reference.sourceColumn)}.referenceOn(${reference.targetColumn.rowSet.name}.${parser.getAttributeName($reference.targetColumn)}));
+#end
+#end
 	}
 	
 	#if($nestTables == true)