db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: BUG: on path expression for multiple joined table (diff Patch inside)
Date Sat, 03 Jul 2004 09:59:12 GMT
hi clovis,

thanks for the patch, ill check it asap.

jakob

Clóvis Wichoski wrote:
> Hi commiters,
> 
> Please see my message "wrong SQL generated when use path expression for 
> extent with Multiple Joined Tab" 
> (http://nagoya.apache.org/eyebrowse/ReadMsg?listName=ojb-user@db.apache.org&msgId=1748602),

> since I don't get any reply I goes to source and found the trouble by my 
> way, above are the patch, please correct if I do any mistake in my tests 
> here works, but maybe some changes on structure to runs better. because 
> I just started using the OJB one week ago ;)
> 
> Another trouble that can appears without this patch is a Database column 
> not found exception if the name of field is diferent from declared on map,
> ie: the class field dateIncluded and database DATE_INCLUDED.
> 
> TIA
> 
> Clóvis
> 
> Index: 
> src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java
> ===================================================================
> RCS file: 
> /home/cvspublic/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java,v

> 
> retrieving revision 1.75
> diff -r1.75 SqlQueryStatement.java
> 838a839,844
>  >                 /** >                 * CW : If used multiple table 
> joins the only way to know Extends to Bind is after the loop
>  >                 *      or better solution for this maybe computed on 
> Metadata discover?
>  >                 **/
>  >                 int nExtendsToBind = 0;
>  >                842,843c848
> <
> <                 c.setNumberOfExtentsToBind(alias.extents.size());
> ---
>  >                848,849c853,860
> <                     buf.append(" OR ");
> <                     appendCriteria(tableAlias, attrInfo.pathInfo, c, 
> buf);
> ---
>  >                    >                     // CW : only if subclass on 
> multiple joined tables redeclared superclass field
>  >                     if 
> (tableAlias.getClassDescriptor().getFieldDescriptorByName(attrInfo.pathInfo.column) 
> != null)
>  >                     {
>  >                         nExtendsToBind++;
>  >                         buf.append(" OR ");
>  >                         appendCriteria(tableAlias, attrInfo.pathInfo, 
> c, buf);
>  >                     }
> 850a862
>  >                 c.setNumberOfExtentsToBind(nExtendsToBind);
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message