Index: trunk/glueforge/templates/psdb/code.tt
===================================================================
--- trunk/glueforge/templates/psdb/code.tt	(revision 4334)
+++ trunk/glueforge/templates/psdb/code.tt	(revision 5907)
@@ -1,8 +1,11 @@
-#include "[% namespace %]db.h"
+#include "[% pkg_name %].h"
 
-#define [% namespace FILTER upper %]_TABLE_NAME "[% table_name %]"
-#define [% namespace FILTER upper %]_INDEX_NAME "position"
+[% FOREACH table = tables -%]
+#define [% table.namespace FILTER upper %]_TABLE_NAME "[% table.name %]"
+#define [% table.namespace FILTER upper %]_INDEX_NAME "position"
+[% END -%]
 #define MAX_STRING_LENGTH 1024
 
+[% FOREACH table = tables -%]
 [% INCLUDE alloc.tt %]
 [% INCLUDE init.tt %]
@@ -19,2 +22,3 @@
 [% INCLUDE metadatafromobject.tt %]
 [% INCLUDE objectfrommetadata.tt -%]
+[% END -%]
