You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by ma...@mpsa.com on 2005/08/08 17:22:26 UTC

using functions with more than one parameters in a criteria or in the attributes




Hello list,
i'm willing to use a function that needs 2 parameters (ie: concat).
If one parameter is not a column or an attribute OJB acheive to produce
correct code.
Example:
    public static void fooDAO(PersistenceBroker broker)
    {
        String[] attributs = {"CONCAT(char(max(purchaseDate)), 'bar')"};
        ReportQueryByCriteria query = new ReportQueryByCriteria(purchase.
class, attributs, null);
        Iterator iter = broker.getReportQueryIteratorByQuery(query);
    }

but if i put two parameters that are either attributes or column name then
ojb failed to replace the attributes (if the two parameters are column
names of course it works but there is a side effect problem with the table
alias).

Also: is there a way to get table alias or to set it in order to avoid some
troubles when you use direct SQL ?

Cordialement

Matthieu PATOU

DINQ/DSIN/SIDM/VNVO/VOIN
Téléphone 01 30 19 17 91  (29 17 91)


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


Re: Réf. : Re: using functions with more than one parameters in a criteria or in the attributes

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi matthieu,

afaik there's no download available so you'll have to get it from cvs head.

hth
jakob

matthieu.patou@mpsa.com schrieb:
> 
> 
> 
> Hi,
> where can i get it ?
> 
> Cordialement
> 
> Matthieu PATOU
> 
> DINQ/DSIN/SIDM/VNVO/VOIN
> Téléphone 01 30 19 17 91  (29 17 91)
> 
> 
> 
>                                                                            
>              Jakob Braeuchi                                                
>              <jbraeuchi@gmx.c                                              
>              h>                                                       Pour 
>                                        OJB Users List                      
>              09/08/2005 22:14          <oj...@db.apache.org>            
>                                                                         cc 
>                                                                            
>                  Veuillez                                            Objet 
>                 répondre à             Re: using functions with more than  
>               OJB Users List           one parameters in a criteria or in  
>              <ojb-user@db.apa          the attributes                      
>                  che.org>                                                  
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
> 
> 
> 
> 
> hi matthieu,
> 
> this is a known issue with ojb 1.0.x. have you tried it with ojb 1.1 ?
> 
> jakob
> 
> matthieu.patou@mpsa.com schrieb:
> 
>>
>>
>>Hello list,
>>i'm willing to use a function that needs 2 parameters (ie: concat).
>>If one parameter is not a column or an attribute OJB acheive to produce
>>correct code.
>>Example:
>>    public static void fooDAO(PersistenceBroker broker)
>>    {
>>        String[] attributs = {"CONCAT(char(max(purchaseDate)), 'bar')"};
>>        ReportQueryByCriteria query = new ReportQueryByCriteria(purchase.
>>class, attributs, null);
>>        Iterator iter = broker.getReportQueryIteratorByQuery(query);
>>    }
>>
>>but if i put two parameters that are either attributes or column name
> 
> then
> 
>>ojb failed to replace the attributes (if the two parameters are column
>>names of course it works but there is a side effect problem with the
> 
> table
> 
>>alias).
>>
>>Also: is there a way to get table alias or to set it in order to avoid
> 
> some
> 
>>troubles when you use direct SQL ?
>>
>>Cordialement
>>
>>Matthieu PATOU
>>
>>DINQ/DSIN/SIDM/VNVO/VOIN
>>Téléphone 01 30 19 17 91  (29 17 91)
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

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


Réf. : Re: using functions with more than one parameters in a criteria or in the attributes

Posted by ma...@mpsa.com.



Hi,
where can i get it ?

Cordialement

Matthieu PATOU

DINQ/DSIN/SIDM/VNVO/VOIN
Téléphone 01 30 19 17 91  (29 17 91)



                                                                           
             Jakob Braeuchi                                                
             <jbraeuchi@gmx.c                                              
             h>                                                       Pour 
                                       OJB Users List                      
             09/08/2005 22:14          <oj...@db.apache.org>            
                                                                        cc 
                                                                           
                 Veuillez                                            Objet 
                répondre à             Re: using functions with more than  
              OJB Users List           one parameters in a criteria or in  
             <ojb-user@db.apa          the attributes                      
                 che.org>                                                  
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




hi matthieu,

this is a known issue with ojb 1.0.x. have you tried it with ojb 1.1 ?

jakob

matthieu.patou@mpsa.com schrieb:
>
>
>
> Hello list,
> i'm willing to use a function that needs 2 parameters (ie: concat).
> If one parameter is not a column or an attribute OJB acheive to produce
> correct code.
> Example:
>     public static void fooDAO(PersistenceBroker broker)
>     {
>         String[] attributs = {"CONCAT(char(max(purchaseDate)), 'bar')"};
>         ReportQueryByCriteria query = new ReportQueryByCriteria(purchase.
> class, attributs, null);
>         Iterator iter = broker.getReportQueryIteratorByQuery(query);
>     }
>
> but if i put two parameters that are either attributes or column name
then
> ojb failed to replace the attributes (if the two parameters are column
> names of course it works but there is a side effect problem with the
table
> alias).
>
> Also: is there a way to get table alias or to set it in order to avoid
some
> troubles when you use direct SQL ?
>
> Cordialement
>
> Matthieu PATOU
>
> DINQ/DSIN/SIDM/VNVO/VOIN
> Téléphone 01 30 19 17 91  (29 17 91)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

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




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


Re: using functions with more than one parameters in a criteria or in the attributes

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi matthieu,

this is a known issue with ojb 1.0.x. have you tried it with ojb 1.1 ?

jakob

matthieu.patou@mpsa.com schrieb:
> 
> 
> 
> Hello list,
> i'm willing to use a function that needs 2 parameters (ie: concat).
> If one parameter is not a column or an attribute OJB acheive to produce
> correct code.
> Example:
>     public static void fooDAO(PersistenceBroker broker)
>     {
>         String[] attributs = {"CONCAT(char(max(purchaseDate)), 'bar')"};
>         ReportQueryByCriteria query = new ReportQueryByCriteria(purchase.
> class, attributs, null);
>         Iterator iter = broker.getReportQueryIteratorByQuery(query);
>     }
> 
> but if i put two parameters that are either attributes or column name then
> ojb failed to replace the attributes (if the two parameters are column
> names of course it works but there is a side effect problem with the table
> alias).
> 
> Also: is there a way to get table alias or to set it in order to avoid some
> troubles when you use direct SQL ?
> 
> Cordialement
> 
> Matthieu PATOU
> 
> DINQ/DSIN/SIDM/VNVO/VOIN
> Téléphone 01 30 19 17 91  (29 17 91)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

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