[appengine-java] Query not working

2009-11-12 Thread dukha
I have a pojo CurrencyPair which I have successfully saved in the
database using jdo.
CurencyPair has a field currencyPair.

Now trying to select in jdo the query works fine so long as there are
no conditions/filters involved. ie I can select all currency pairs
like this

PersistenceManager pm= getPersistenceManager();
Query query = pm.newQuery(CurrencyPair.class);
List l = (List)query.execute();

This gives
USD.JPY
GBP.JPY
EUR.GBP
EUR.USD
USD.CAD
AUD.USD
USD.CHF
EUR.JPY
EUR.CHF
GBP.USD

PersistenceManager pm= getPersistenceManager();
Query query = pm.newQuery(CurrencyPair.class,"currencyPair ==
'AUD.USD'");
List l = (List)query.execute();

returns  no data.

I've tried all all combinatioins of setting a filter and declaring a
parameter or putting the whole query in 1 String according to the gae
getting started guide.
I have no idea what I'm doing wrong. any help would be appreciated.

Thanks.
Dukha

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=.




Re: [appengine-java] Query not working

2009-11-12 Thread David Brown
Have you tried using an outside tool like TOAD or DBVIS to run your query
first as a test? Or can you JUnit your query?

On Thu, Nov 12, 2009 at 2:11 AM, dukha  wrote:

> I have a pojo CurrencyPair which I have successfully saved in the
> database using jdo.
> CurencyPair has a field currencyPair.
>
> Now trying to select in jdo the query works fine so long as there are
> no conditions/filters involved. ie I can select all currency pairs
> like this
>
> PersistenceManager pm= getPersistenceManager();
> Query query = pm.newQuery(CurrencyPair.class);
> List l = (List)query.execute();
>
> This gives
> USD.JPY
> GBP.JPY
> EUR.GBP
> EUR.USD
> USD.CAD
> AUD.USD
> USD.CHF
> EUR.JPY
> EUR.CHF
> GBP.USD
>
> PersistenceManager pm= getPersistenceManager();
> Query query = pm.newQuery(CurrencyPair.class,"currencyPair ==
> 'AUD.USD'");
> List l = (List)query.execute();
>
> returns  no data.
>
> I've tried all all combinatioins of setting a filter and declaring a
> parameter or putting the whole query in 1 String according to the gae
> getting started guide.
> I have no idea what I'm doing wrong. any help would be appreciated.
>
> Thanks.
> Dukha
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=.