db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1371369 - /db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/peerImplCreator.vm
Date Thu, 09 Aug 2012 18:42:04 GMT
Author: tv
Date: Thu Aug  9 18:42:04 2012
New Revision: 1371369

URL: http://svn.apache.org/viewvc?rev=1371369&view=rev
Log:
Care for injection of database name, table map and record mapper

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/peerImplCreator.vm

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/peerImplCreator.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/peerImplCreator.vm?rev=1371369&r1=1371368&r2=1371369&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/peerImplCreator.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/peerImplCreator.vm
Thu Aug  9 18:42:04 2012
@@ -32,6 +32,13 @@
      */
     protected static ${peerImplClassName} create${peerImplClassName}()
     {
-        return new ${peerImplClassName}();
+        ${peerImplClassName} instance = new ${peerImplClassName}();
+        instance.setRecordMapper(new $recordMapperClassName());
+        instance.setTableMap(
+            Torque.getDatabaseMap(${peerClassName}.DATABASE_NAME)
+                 .getTable(${peerClassName}.TABLE_NAME));
+        instance.setDatabaseName(${peerClassName}.DATABASE_NAME);
+        
+        return instance;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message