hi andrey,

thanks for your help.
could you please integrate your fix into to latest from cvs ???

jakob

----- Original Message -----
From: "Andrey Chernyh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 30, 2002 10:52 AM
Subject: Re:Bug in OQL with joins


> Hi again.
> I've already found the solution:
> SqlStatement.java:
> @@ -346,6 +359,18 @@
>                  {
>                      // must be n:1 or 1:1
>                      cld = getItemClassDescriptor(ord,attr);
> +                  //find implementor's descriptor for correct table name
when joining
> +                  if ( cld.isInterface() )
> +                  {
> +                    if (cld.getExtentClasses().size() == 0)
> +                    {
> +                      throw new PersistenceBrokerException(
> +                                                           "No
Implementors declared for interface " + cld.getClassOfObject().getName());
> +                    }
> +                    Class implementor = (Class)
cld.getExtentClasses().get(0);
> +                    ClassDescriptor implCld =
cld.getRepository().getDescriptorFor(implementor);
> +                    cld = implCld;
> +                  }
>
>                      prevKeys =
ord.getForeignKeyFieldDescriptors(prev.cld);
>                      keys = cld.getPkFields();
>
>
>
>
> >    Criteria criteria = new Criteria();
>
> >    criteria.addEqualTo( "plan.name", "aaaa" );
>
> >    Query query = new QueryByCriteria( Subscription.class, criteria );
>
> >    Collection queryResult = db.getByQuery( query );
> >Result sql is:
> > SELECT A0.state,A0.id,A0.end_date,A0.begin_date,A0.plan_id, A0.owner_id
> > FROM
> > subscription A0
> > INNER JOIN
> >>>  null  <<<  A1 ON A0.plan_id=A1.id WHERE plan.name =  'aaaa'
>
>
>
> Best regards,
> Andrey Chernyh<[EMAIL PROTECTED]>
> Plesk Inc.
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to