[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2239) createSQLQuery.addJoin sometimes doesn't work correctly
Stoyan Stoyanov (JIRA)
noreply at atlassian.com
Tue Nov 14 10:52:04 EST 2006
createSQLQuery.addJoin sometimes doesn't work correctly
-------------------------------------------------------
Key: HHH-2239
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2239
Project: Hibernate3
Type: Bug
Components: query-sql
Reporter: Stoyan Stoyanov
Sorry, I have no enough time for details now. I will give you just a hint.
The bug is in method:
private String SQLQueryParser.substituteBrackets() throws QueryException {
....
else {
String aliasName = aliasPath.substring(0, firstDot);
int collectionIndex = Arrays.binarySearch(collectionAliases, aliasName);
boolean isCollection = collectionIndex>-1;
boolean isEntity = isEntityAlias(aliasName);
....
}
As you can see in the code Arrays.binarySearch. The member 'collectionAliases' is NOT sorted. The 'collectionAliases' order depends on (1) SQLQuery.addJoin order calls in application code and (2) the dependences between "joined" items.
'collectionAliases' member is passed as SQLQueryParser a NOT sorted contructor parameter.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list