Author: dstephan
Date: 2008-11-04 20:51:02 -0500 (Tue, 04 Nov 2008)
New Revision: 15512
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/tree/FromClause.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java
Log:
JBPAPP-1365 - Backport of HHH-2159
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/tree/FromClause.java
===================================================================
---
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/tree/FromClause.java 2008-11-05
01:46:59 UTC (rev 15511)
+++
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/tree/FromClause.java 2008-11-05
01:51:02 UTC (rev 15512)
@@ -85,13 +85,14 @@
}
void addDuplicateAlias(String alias, FromElement element) {
- fromElementByClassAlias.put( alias, element );
+ if ( alias != null ) {
+ fromElementByClassAlias.put( alias, element );
+ }
}
private void checkForDuplicateClassAlias(String classAlias) throws SemanticException {
if ( classAlias != null && fromElementByClassAlias.containsKey( classAlias ) )
{
- throw new SemanticException( "Duplicate definition of alias '"
- + classAlias + "'" );
+ throw new SemanticException( "Duplicate definition of alias '" +
classAlias + "'" );
}
}
Modified:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java
===================================================================
---
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java 2008-11-05
01:46:59 UTC (rev 15511)
+++
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java 2008-11-05
01:51:02 UTC (rev 15512)
@@ -41,6 +41,12 @@
s.close();
}
+ public void testIdentifierCasesensitivityAndDuplicateFromElements() throws Exception {
+ Session s = openSession();
+ s.createQuery( "select e from MyEntity e where exists (select 1 from MyEntity e2
where e2.other.name = 'something' and e2.other.other = e)" );
+ s.close();
+ }
+
public void testGeneratedSubquery() {
Session s = openSession();
s.createQuery( "select c FROM Item c WHERE c.parts IS EMPTY" ).list();
Show replies by date