You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2011/09/10 13:57:59 UTC
svn commit: r1167499 -
/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/doBuild.vm
Author: tfischer
Date: Sat Sep 10 11:57:59 2011
New Revision: 1167499
URL: http://svn.apache.org/viewvc?rev=1167499&view=rev
Log:
- explicit check if db adapter is set when building the database map
- changed comment about implementation from java comment to velocity comment
Modified:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/doBuild.vm
Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/doBuild.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/doBuild.vm?rev=1167499&r1=1167498&r2=1167499&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/doBuild.vm (original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/doBuild.vm Sat Sep 10 11:57:59 2011
@@ -67,8 +67,8 @@
#end
#set ( $idMethodParameterElements = $tableElement.getChildren("id-method-parameter"))
#if (!$idMethodParameterElements.isEmpty())
- // this might need upgrading based on what all the databases
- // need, but for now assume one parameter.
+## this might need upgrading based on what all the databases
+## need, but for now assume one parameter.
#set ( $idMethodParameterElement = $idMethodParameterElements.get(0) )
#set ( $value = $idMethodParameterElement.getAttribute("value") )
tMap.setPrimaryKeyMethodInfo("$value");
@@ -76,6 +76,10 @@
tMap.setPrimaryKeyMethodInfo(tMap.getName());
#elseif ($idMethod == "native")
org.apache.torque.adapter.DB dbAdapter = Torque.getDB("$databaseName");
+ if (dbAdapter == null)
+ {
+ throw new TorqueException("missing adapter configuration for database ${databaseName}, check the Torque configuration");
+ }
if (dbAdapter.getIDMethodType().equals(org.apache.torque.adapter.DB.SEQUENCE))
{
tMap.setPrimaryKeyMethodInfo("$sequence");
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org