Author: steve.ebersole(a)jboss.com
Date: 2006-11-16 15:21:47 -0500 (Thu, 16 Nov 2006)
New Revision: 10829
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/hql/classic/PathExpressionParser.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/HQLTest.java
Log:
classic translator fix due to change in EntityType
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/hql/classic/PathExpressionParser.java
===================================================================
---
branches/Branch_3_2/Hibernate3/src/org/hibernate/hql/classic/PathExpressionParser.java 2006-11-16
19:49:01 UTC (rev 10828)
+++
branches/Branch_3_2/Hibernate3/src/org/hibernate/hql/classic/PathExpressionParser.java 2006-11-16
20:21:47 UTC (rev 10829)
@@ -187,8 +187,9 @@
catch ( MappingException me ) {
throw new QueryException( me );
}
- boolean isNamedIdPropertyShortcut = idPropertyName != null &&
- idPropertyName.equals( propertyName );
+ boolean isNamedIdPropertyShortcut = idPropertyName != null
+ && idPropertyName.equals( propertyName )
+ && propertyType.isReferenceToPrimaryKey();
if ( isIdShortcut || isNamedIdPropertyShortcut ) {
// special shortcut for id properties, skip the join!
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
---
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2006-11-16
19:49:01 UTC (rev 10828)
+++
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2006-11-16
20:21:47 UTC (rev 10829)
@@ -99,6 +99,9 @@
// caused the classic parser to suddenly start throwing exceptions on
// this query, apparently relying on the buggy behavior somehow; thus
// moved here to at least get some syntax checking...
+ //
+ // fyi... found and fixed the problem in the classic parser; still
+ // leaving here for syntax checking
new SyntaxChecker( "from Commento c where c.marelo.commento.mcompr is null"
).checkAll();
}
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/HQLTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/HQLTest.java 2006-11-16
19:49:01 UTC (rev 10828)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/HQLTest.java 2006-11-16
20:21:47 UTC (rev 10829)
@@ -1016,6 +1016,11 @@
assertTranslation( "from Baz baz inner join baz.components comp where
comp.name='foo'" );
}
+ public void testNestedComponentIsNull() {
+ // From MapTest...
+ assertTranslation( "from Commento c where c.marelo.commento.mcompr is null"
);
+ }
+
public void testOneToOneJoinedFetch() throws Exception {
// From OneToOneTest.testOneToOneOnSubclass
assertTranslation( "from org.hibernate.test.onetoone.joined.Person p join fetch
p.address left join fetch p.mailingAddress" );
Show replies by date