Re: count(*) with parameter

2010-04-21 Thread Arnaud Garcia
thanks all arnaud 2010/4/19 Joe Baldwin > Arnaud, > > For example: I think you can add stored procedures via the CayenneModeler > (CM). I have not used this feature yet, and so I do not know if this is > even an optimum solution. (Maybe the Cayenne team knows the answer to > this.) > > You cou

Re: count(*) with parameter

2010-04-19 Thread Joe Baldwin
Arnaud, For example: I think you can add stored procedures via the CayenneModeler (CM). I have not used this feature yet, and so I do not know if this is even an optimum solution. (Maybe the Cayenne team knows the answer to this.) You could try this out and then do some performance testing to

Re: count(*) with parameter

2010-04-19 Thread Arnaud Garcia
Hi and thanks, Well both, modeler and code (just for my cayenne understanding...) And in the modeler ? Arnaud 2010/4/18 Joe Baldwin > Arnaud, > > If I understand you, I think you want to do this in the code and not the > modeler? > > Here is a simple code fragment for a like-ignore-case qualif

Re: count(*) with parameter

2010-04-18 Thread Florin T.PATRASCU
or something like this: ... String sql = "select count(*) as total_clicks from user_clicks " + " where user_id = #bind( $userId, 'VARCHAR')"; SQLTemplate sqlTemplate = new SQLTemplate( UserClick.class, sql); sqlTemplate.setParameters(params); //params defined elsewhere sqlTempl

Re: count(*) with parameter

2010-04-18 Thread Joe Baldwin
Arnaud, If I understand you, I think you want to do this in the code and not the modeler? Here is a simple code fragment for a like-ignore-case qualifier: String substring = "Martin"; ObjectContext oc = BaseContext.getThreadObjectContext(); Expression exp = ExpressionFa

count(*) with parameter

2010-04-18 Thread Arnaud Garcia
Hello, I am not sure how to create a select count(*) in the modeler when I need to pass a parameter ? I downloaded the petstore example, and it seems that I have to create a "Raw SQL" Query, and directly write my select count(*)... =>but how to I had my parameter in my SQL ? ... then I suppose I