[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-2189) Left Outer Join Conditions

Diego Pires Plentz (JIRA) noreply at atlassian.com
Wed Aug 15 21:35:13 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Diego Pires Plentz resolved HHH-2189.
-------------------------------------

      Assignee: Diego Pires Plentz
    Resolution: Duplicate

> Left Outer Join Conditions
> --------------------------
>
>                 Key: HHH-2189
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2189
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: query-sql
>    Affects Versions: 3.1.3
>            Reporter: yann degat
>            Assignee: Diego Pires Plentz
>            Priority: Blocker
>         Attachments: OracleJoinFragment.java, OracleJoinFragment.java, SUP-3701.zip
>
>   Original Estimate: 10 minutes
>  Remaining Estimate: 10 minutes
>
> the "org.hibernate.sql.OracleJoinFragment.addLeftOuterJoinCondition"
> does not take the "!=" operator into account.
> it places the "(+)" like this "!(+)=" instead of " (+) !="
> (  != is a valid operator for Oracle )
> and it returns  (+)<(+)> for the '<>' operator
> here's a patch. (maybe not the best one )
> 	/**
> 	 * This method is a bit of a hack, and assumes
> 	 * that the column on the "right" side of the
> 	 * join appears on the "left" side of the
> 	 * operator, which is extremely wierd if this
> 	 * was a normal join condition, but is natural
> 	 * for a filter.
> 	 */
> 	private void addLeftOuterJoinCondition(String on) {
> 		StringBuffer buf = new StringBuffer( on );
> 		for ( int i = 0; i < buf.length(); i++ ) {
>             char character = buf.charAt( i );
>             boolean isInsertPoint = OPERATORS.contains( new Character( character ) ) ||
>            ( character == ' ' && buf.length() > i + 3 && "is ".equals( buf.substring( i + 1, i + 4 ) ) ) ;
>             if( character == '<' && buf.length() > i + 1 && ">".equals( buf.substring( i + 1, i + 2 ) ) ){
>                 isInsertPoint = false;
>                 buf.insert( i, "(+)" );
>                 i += 3 + 2;
>             }
>             
>             if ( isInsertPoint ) {
>                 buf.insert( i, "(+)" );
>                 i += 3;
>             }
>            if( character == '!' && buf.length() > i + 1 && "=".equals( buf.substring( i + 1, i + 2 ) ) ){
>                buf.insert( i, "(+)" );
>                i += 3 + 2;
>            }
> 		}
> 		addCondition( buf.toString() );
> 	}

-- 
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