Should just be:
query.setFilter("lastName == lastNameParam && hireDate > hireDateMinimum");
query.declareParameters("String lastNameParam, Date hireDateMinimum");
query.execute(lastnamevar, hiredatevar);
Look at the sharded counters article for a demo:
http://code.google.com/appengine/articles/sharding_counters.html
Robert
On Sat, Mar 6, 2010 at 1:14 AM, santosh mantri <[email protected]> wrote:
>
>
> query.setFilter("lastName == 'Smith' && hireDate > hireDateMinimum");
> query.declareParameters("Date hireDateMinimum");
>
> in this example value to be compared with "lastname" is hardcoded as
> "Smith" and there is only one dynamic parameter as hireDateMinimum...
>
> But i want both parameter to be dynamic..and there is no any such example i
> have gone thru many forums but did not find anythng usefull on this issue..
>
>
> On Sat, Mar 6, 2010 at 11:24 AM, Robert Kluin <[email protected]>
> wrote:
>>
>> Aren't you asking how to filter on two properties? As in this example:
>> query.setFilter("lastName == 'Smith' && hireDate > hireDateMinimum");
>> query.declareParameters("Date hireDateMinimum");
>>
>>
>> Robert
>>
>>
>>
>>
>> On Sat, Mar 6, 2010 at 12:42 AM, santosh mantri <[email protected]>
>> wrote:
>> > ya,I had gone through it but it do not have any solution for problem
>> > that
>> > i'm facing..
>> >
>> > On Sat, Mar 6, 2010 at 3:22 AM, Robert Kluin <[email protected]>
>> > wrote:
>> >>
>> >> Santosh,
>> >> Have a look at the "Query Filters" section here:
>> >>
>> >>
>> >> http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Introducing_Queries
>> >>
>> >> They have several examples there.
>> >>
>> >>
>> >> Robert
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Fri, Mar 5, 2010 at 2:18 PM, santosh mantri <[email protected]>
>> >> wrote:
>> >> > Hi robert..
>> >> > Actully my code is not with me right now..
>> >> > by the way i'm using java api for the same..
>> >> > code is gvn below..it may have some syntactical error...
>> >> > pm is Persistence data manager
>> >> >
>> >> > Query q=pm.newQuery();
>> >> > q.declareParameter("String param");
>> >> > q.setfilter("id==param");
>> >> > List<MyClass> ls=(List<MyClass>) q.execute();
>> >> > .
>> >> > .
>> >> > .
>> >> > .
>> >> > The way i declared param as parameter for query ,I want to declare
>> >> > one
>> >> > more
>> >> > parameter and set one more filter..
>> >> > I think it will clear the idea now..
>> >> > On Fri, Mar 5, 2010 at 10:48 AM, Robert Kluin
>> >> > <[email protected]>
>> >> > wrote:
>> >> >>
>> >> >> Can you post the code you are using right now, or at least ell us
>> >> >> what
>> >> >> language you are using?
>> >> >>
>> >> >> Robert
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> On Fri, Mar 5, 2010 at 10:42 AM, santosh mantri
>> >> >> <[email protected]>
>> >> >> wrote:
>> >> >> > Hi m using ape for some application,,,and i want to retrive object
>> >> >> > from datastore based on two condition...my code works fine for one
>> >> >> > parameter,,but need help on how to declare two parameters and
>> >> >> > setting
>> >> >> > filter for them...
>> >> >> > it would b great if somebody can help me on this...
>> >> >> > thanks in advance...
>> >> >> >
>> >> >> > --
>> >> >> > You received this message because you are subscribed to the Google
>> >> >> > Groups "Google App Engine" group.
>> >> >> > To post to this group, send email to
>> >> >> > [email protected].
>> >> >> > To unsubscribe from this group, send email to
>> >> >> > [email protected].
>> >> >> > For more options, visit this group at
>> >> >> > http://groups.google.com/group/google-appengine?hl=en.
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> You received this message because you are subscribed to the Google
>> >> >> Groups
>> >> >> "Google App Engine" group.
>> >> >> To post to this group, send email to
>> >> >> [email protected].
>> >> >> To unsubscribe from this group, send email to
>> >> >> [email protected].
>> >> >> For more options, visit this group at
>> >> >> http://groups.google.com/group/google-appengine?hl=en.
>> >> >>
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "Google App Engine" group.
>> >> > To post to this group, send email to
>> >> > [email protected].
>> >> > To unsubscribe from this group, send email to
>> >> > [email protected].
>> >> > For more options, visit this group at
>> >> > http://groups.google.com/group/google-appengine?hl=en.
>> >> >
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "Google App Engine" group.
>> >> To post to this group, send email to [email protected].
>> >> To unsubscribe from this group, send email to
>> >> [email protected].
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/google-appengine?hl=en.
>> >>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Google App Engine" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> > [email protected].
>> > For more options, visit this group at
>> > http://groups.google.com/group/google-appengine?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.