Author: tfischer Date: Wed Feb 20 20:53:14 2013 New Revision: 1448399 URL: http://svn.apache.org/r1448399 Log: TORQUE-267 Fix optimistic locking tests for managers profile
Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java db/torque/torque4/trunk/torque-test/src/main/schema/test-schema.xml Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java?rev=1448399&r1=1448398&r2=1448399&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java (original) +++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java Wed Feb 20 20:53:14 2013 @@ -339,22 +339,30 @@ public class OMTableAndViewTransformer e + interfaceName.substring(1); } - String managerClassName = controllerState.getOption( - TemplateOptionName.OM_MANAGER_CLASS_NAME_PREFIX) - + interfaceName - + controllerState.getOption( - TemplateOptionName.OM_MANAGER_CLASS_NAME_SUFFIX); - tableElement.setAttribute( - TableAttributeName.MANAGER_CLASS_NAME, - managerClassName); - String baseManagerClassName = controllerState.getOption( - "torque.om.className.baseManagerClassNamePrefix") - + interfaceName - + controllerState.getOption( - "torque.om.className.baseManagerClassNameSuffix"); - tableElement.setAttribute( - TableAttributeName.BASE_MANAGER_CLASS_NAME, - baseManagerClassName); + if (tableElement.getAttribute(TableAttributeName.MANAGER_CLASS_NAME) + == null) + { + String managerClassName = controllerState.getOption( + TemplateOptionName.OM_MANAGER_CLASS_NAME_PREFIX) + + interfaceName + + controllerState.getOption( + TemplateOptionName.OM_MANAGER_CLASS_NAME_SUFFIX); + tableElement.setAttribute( + TableAttributeName.MANAGER_CLASS_NAME, + managerClassName); + } + if (tableElement.getAttribute( + TableAttributeName.BASE_MANAGER_CLASS_NAME) == null) + { + String baseManagerClassName = controllerState.getOption( + "torque.om.className.baseManagerClassNamePrefix") + + interfaceName + + controllerState.getOption( + "torque.om.className.baseManagerClassNameSuffix"); + tableElement.setAttribute( + TableAttributeName.BASE_MANAGER_CLASS_NAME, + baseManagerClassName); + } } } Modified: db/torque/torque4/trunk/torque-test/src/main/schema/test-schema.xml URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/main/schema/test-schema.xml?rev=1448399&r1=1448398&r2=1448399&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-test/src/main/schema/test-schema.xml (original) +++ db/torque/torque4/trunk/torque-test/src/main/schema/test-schema.xml Wed Feb 20 20:53:14 2013 @@ -136,6 +136,8 @@ <table name="optimistic_locking" interface="org.apache.torque.OptimisticLockingInterface" peerInterface="org.apache.torque.OptimisticLockingPeerInterface<org.apache.torque.test.dbobject.OptimisticLocking>" + managerClassName="OptimisticLockingManager" + baseManagerClassName="BaseOptimisticLockingManager" description="this table implements optimistic Locking with the selectForUpdate mode"> <column name="id" primaryKey="true" type="INTEGER" /> <column name="name" type="VARCHAR" size="50" /> @@ -144,6 +146,8 @@ <table name="optimistic_locking_simple" optimisticLockingMode="simpleSelect" interface="org.apache.torque.OptimisticLockingInterface" peerInterface="org.apache.torque.OptimisticLockingPeerInterface<org.apache.torque.test.dbobject.OptimisticLockingSimple>" + managerClassName="OptimisticLockingSimpleManager" + baseManagerClassName="BaseOptimisticLockingSimpleManager" description="this table implements optimistic Locking with the simple select mode"> <column name="id" primaryKey="true" type="INTEGER" /> <column name="name" type="VARCHAR" size="50" /> --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org For additional commands, e-mail: torque-dev-h...@db.apache.org