Author: tfischer
Date: Fri May 13 20:00:32 2011
New Revision: 1102880
URL: http://svn.apache.org/viewvc?rev=1102880&view=rev
Log:
Do not generate the joinAllExcept methods in the DbObject classes. These
methods were commented out in the 3.3 templates and were only re-introduced by
mistake.
Modified:
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/ForeignKeyChildAttributeName.java
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMForeignKeyTransformer.java
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/joinGetterReferencingObject.vm
Modified:
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/ForeignKeyChildAttributeName.java
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/ForeignKeyChildAttributeName.java?rev=1102880&r1=1102879&r2=1102880&view=diff
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/ForeignKeyChildAttributeName.java
(original)
+++
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/ForeignKeyChildAttributeName.java
Fri May 13 20:00:32 2011
@@ -35,13 +35,6 @@ public enum ForeignKeyChildAttributeName
FOREIGN_FIELD_JOIN_GETTER("joinGetter"),
/**
- * The name of the getter method in the database object
- * which joins all the other tables except the referenced table.
- * TODO: is this used at all ?
- */
- FOREIGN_FIELD_JOIN_ALL_EXCEPT_GETTER("joinAllExceptGetter"),
-
- /**
* The name of the peer class method which joins the other table.
*/
PEER_JOIN_SELECT_METHOD("peerJoinSelectMethod"),
Modified:
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMForeignKeyTransformer.java
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMForeignKeyTransformer.java?rev=1102880&r1=1102879&r2=1102880&view=diff
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMForeignKeyTransformer.java
(original)
+++
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMForeignKeyTransformer.java
Fri May 13 20:00:32 2011
@@ -304,24 +304,6 @@ public class OMForeignKeyTransformer
joinGetterName);
}
{
- // Name for a getter in the foreign table to
- // retrieve entries in the foreign table plus all joined
- // entries, except the entries in the local table.
- String joinAllExceptGetterFieldName
- = StringUtils.capitalize(getterSetterFieldName)
- + "sJoinAllExcept"
- + foreignTable.getAttribute(
- TorqueSchemaAttributeName.JAVA_NAME);
- String joinAllExceptGetterName = FieldHelper.getGetterName(
- joinAllExceptGetterFieldName,
- fieldType,
- controllerState);
- foreignFieldElement.setAttribute(
- ForeignKeyChildAttributeName
- .FOREIGN_FIELD_JOIN_GETTER,
- joinAllExceptGetterName);
- }
- {
// Name for the doSelectJoinXXX method in the Peer Class
// of the foreign table.
String peerJoinSelectMethodName
Modified:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/joinGetterReferencingObject.vm
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/joinGetterReferencingObject.vm?rev=1102880&r1=1102879&r2=1102880&view=diff
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/joinGetterReferencingObject.vm
(original)
+++
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/joinGetterReferencingObject.vm
Fri May 13 20:00:32 2011
@@ -121,94 +121,3 @@
return ${otherTablePeerName}.${peerJoinSelectMethod}(criteria,
connection);
#end
}
-
-#if ($thisTableElement.getChildren("referencing-foreign-keys").size() > 2)
- #if ($silentDbFetch)
- /**
- #if ($objectIsCaching)
- * If this collection has already been initialized with
- * an identical criteria, it returns the collection.
- * Otherwise if this $thisObjectClassName is new, it will return
- #else
- * If this $thisObjectClassName is new, this method will return
- #end
- * an empty collection; or if this $thisObjectClassName has previously
- * been saved, it will retrieve related objects from the database.
- *
- * This method is protected by default in order to keep the public
- * api reasonable. You can change the access modifier to public
- * by overriding this method in the child class.
- */
- protected $fieldType ${joinAllExceptGetter}(Criteria criteria)
- throws TorqueException
- {
- $fieldType ${joinAllExceptGetter}(Criteria criteria, null);
- }
-
- #end
- /**
- #if ($objectIsCaching)
- * If this collection has already been initialized with
- * an identical criteria, it returns the collection.
- * Otherwise if this $thisObjectClassName is new, it will return
- #else
- * If this $thisObjectClassName is new, this method will return
- #end
- * an empty collection; or if this $thisObjectClassName has previously
- * been saved, it will retrieve related objects from the database.
- *
- * This method is protected by default in order to keep the public
- * api reasonable. You can change the access modifier to public
- * by overriding this method in the child class.
- */
- protected $fieldType ${joinAllExceptGetter}(Criteria criteria, Connection
connection)
- throws TorqueException
- {
- #if ($objectIsCaching)
- if ($field == null)
- {
- if (isNew())
- {
- ${initializer}();
- }
- else
- {
- #foreach ($referenceElement in $referenceElements)
- #set ( $otherTableColumnElement =
$referenceElement.getChild("local-column").getChild("column") )
- #set ( $thisTableColumnElement =
$referenceElement.getChild("foreign-column").getChild("column") )
- #set ( $otherTablePeerColumnName =
$otherTableColumnElement.getAttribute("peerColumnName") )
- #set ( $thisTableColumnGetter =
$thisTableColumnElement.getAttribute("getter") )
-
criteria.add(${otherTablePeerName}.${otherTablePeerColumnName},
${thisTableColumnGetter}() );
- #end
- $field =
${otherTablePeerName}.${peerJoinAllExceptSelectMethod}(criteria, connection);
- }
- }
- else
- {
- // the following code is to determine if a new query is
- // called for. If the criteria is the same as the last
- // one, just return the collection.
- #end
- #foreach ($referenceElement in $referenceElements)
- #set ( $otherTableColumnElement =
$referenceElement.getChild("local-column").getChild("column") )
- #set ( $thisTableColumnElement =
$referenceElement.getChild("foreign-column").getChild("column") )
- #set ( $otherTablePeerColumnName =
$otherTableColumnElement.getAttribute("peerColumnName") )
- #set ( $thisTableColumnGetter =
$thisTableColumnElement.getAttribute("getter") )
- criteria.add(${otherTablePeerName}.${otherTablePeerColumnName},
${thisTableColumnGetter}() );
- #end
- #if ($objectIsCaching)
- if (!${criteriaCacheField}.equals(criteria))
- {
- $field =
${otherTablePeerName}.${peerJoinAllExceptSelectMethod}(criteria, connection);
- }
- }
- $criteriaCacheField = criteria;
-
- return $field;
- #else
- return
${otherTablePeerName}.${peerJoinAllExceptSelectMethod}(criteria, connection);
- #end
- }
-
- #end
-
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]