[hibernate-commits] Hibernate SVN: r10934 - branches/Branch_3_2/Hibernate3/src/org/hibernate/hql/ast/tree
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Tue Dec 5 15:36:36 EST 2006
Author: steve.ebersole at jboss.com
Date: 2006-12-05 15:36:35 -0500 (Tue, 05 Dec 2006)
New Revision: 10934
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/hql/ast/tree/DotNode.java
Log:
(follow-on) HHH-2257 : implicit joins and shallow queries
Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/hql/ast/tree/DotNode.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/hql/ast/tree/DotNode.java 2006-12-05 20:36:11 UTC (rev 10933)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/hql/ast/tree/DotNode.java 2006-12-05 20:36:35 UTC (rev 10934)
@@ -286,10 +286,11 @@
private void dereferenceEntity(EntityType entityType, boolean implicitJoin, String classAlias, boolean generateJoin, AST parent) throws SemanticException {
checkForCorrelatedSubquery( "dereferenceEntity" );
- // two general cases we check here:
+ // three general cases we check here:
// 1) is our parent a DotNode as well? If so, our property reference is
// being further de-referenced...
- // 2) we were asked to generate any needed joins (generateJoins==true) *OR*
+ // 2) is this a DML statement
+ // 3) we were asked to generate any needed joins (generateJoins==true) *OR*
// the current parser state indicates to use an INNER JOIN for implicit joins
//
// The "implicit join" portion of the second condition was done to account for
@@ -310,6 +311,9 @@
property = parentAsDotNode.propertyName;
joinIsNeeded = generateJoin && !isReferenceToPrimaryKey( parentAsDotNode.propertyName, entityType );
}
+ else if ( ! getWalker().isSelectStatement() ) {
+ joinIsNeeded = false;
+ }
else {
// otherwise we need to generate the join if we were asked to, or
// if the current implicit join type is INNER JOINs
More information about the hibernate-commits
mailing list