HHH-2159 : NullPointerException in FromElement#findIntendedAliasedFromElementBasedOnCrazyJPARequirements
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14050 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
4a7615fd42
commit
430a94b5ab
|
@ -85,13 +85,14 @@ public class FromClause extends HqlSqlWalkerNode implements HqlSqlTokenTypes, Di
|
|||
}
|
||||
|
||||
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 + "'" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,12 @@ public class JPAQLComplianceTest extends AbstractJPATest {
|
|||
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();
|
||||
|
|
Loading…
Reference in New Issue