Bug in SqlJdbcUtil.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in SqlJdbcUtil.java

Mamdouh Kaadan-2
Dear

 

There is a problem in SqlJdbcUtil.java class regarding outer join in
oracle, becase the (+) sould be in the end of the Left/Right hand not in
the first

 

The following line (number: 344):

if (isOracleStyle && viewLink.isRelOptional()) whereString.append(" (+)
");

 

Should be placed after the following lines:

whereString.append(viewLink.getRelEntityAlias());

                        whereString.append(".");

 
whereString.append(filterColName(relLinkField.getColName()));

 

So the entier code will be like this:

 

// check to see whether the left or right members are optional, if so:

                        // oracle: use the (+) on the optional side

                        // mssql: use the * on the required side

 

                        // NOTE: not testing if original table is
optional, ONLY if related table is optional; otherwise things get really
ugly...

                        // if (isOracleStyle &&
linkMemberEntity.getOptional()) whereString.append(" (+) ");

                        if (isMssqlStyle && viewLink.isRelOptional())
whereString.append("*");

                        whereString.append("=");

                        // if (isMssqlStyle &&
linkMemberEntity.getOptional()) whereString.append("*");

                       

 
whereString.append(viewLink.getRelEntityAlias());

                        whereString.append(".");

 
whereString.append(filterColName(relLinkField.getColName()));

                       

                        if (isOracleStyle && viewLink.isRelOptional())
whereString.append(" (+) ");

 

Kind regards

==================================

Mamdouh Kaadan

Software Engineer

IT - Application

Areeba SYRIA

Mobile: +963-94-222763

Office :  +963-94-222222   Ext: 2288

E-mail:[hidden email]

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Bug in SqlJdbcUtil.java

David E Jones

I was hoping to review this, but really won't have time in the near  
future nor a test bed to play with it on.

The best way to go forward with this would be to create a Jira issue  
and attach a patch to it with this fix, and then send an email to  
this mailing list and request that people with Oracle and SQL Server  
test this with the join style in the appropriate theta join mode.

-David


On Mar 17, 2007, at 7:34 AM, Mamdouh Kaadan wrote:

> Dear
>
>
>
> There is a problem in SqlJdbcUtil.java class regarding outer join in
> oracle, becase the (+) sould be in the end of the Left/Right hand  
> not in
> the first
>
>
>
> The following line (number: 344):
>
> if (isOracleStyle && viewLink.isRelOptional()) whereString.append
> (" (+)
> ");
>
>
>
> Should be placed after the following lines:
>
> whereString.append(viewLink.getRelEntityAlias());
>
>                         whereString.append(".");
>
>
> whereString.append(filterColName(relLinkField.getColName()));
>
>
>
> So the entier code will be like this:
>
>
>
> // check to see whether the left or right members are optional, if so:
>
>                         // oracle: use the (+) on the optional side
>
>                         // mssql: use the * on the required side
>
>
>
>                         // NOTE: not testing if original table is
> optional, ONLY if related table is optional; otherwise things get  
> really
> ugly...
>
>                         // if (isOracleStyle &&
> linkMemberEntity.getOptional()) whereString.append(" (+) ");
>
>                         if (isMssqlStyle && viewLink.isRelOptional())
> whereString.append("*");
>
>                         whereString.append("=");
>
>                         // if (isMssqlStyle &&
> linkMemberEntity.getOptional()) whereString.append("*");
>
>
>
>
> whereString.append(viewLink.getRelEntityAlias());
>
>                         whereString.append(".");
>
>
> whereString.append(filterColName(relLinkField.getColName()));
>
>
>
>                         if (isOracleStyle && viewLink.isRelOptional())
> whereString.append(" (+) ");
>
>
>
> Kind regards
>
> ==================================
>
> Mamdouh Kaadan
>
> Software Engineer
>
> IT - Application
>
> Areeba SYRIA
>
> Mobile: +963-94-222763
>
> Office :  +963-94-222222   Ext: 2288
>
> E-mail:[hidden email]
>
>
>
>
>
>
>


smime.p7s (3K) Download Attachment