[appengine-java] Re: One-to-many querying for a child instance

2010-01-30 Thread Sydney
The thread http://groups.google.com/group/google-appengine-java/browse_thread/thread/2acea43161d8ac5/96c77de6c686526d?lnk=gst is dealing with the same kind of problem. Basically it's not possible to filter on the name property. So I guess I have two ways of doing it. 1/ Creating the key by hand

Re: [appengine-java] Re: One-to-many querying for a child instance

2010-01-27 Thread Rusty Wright
Do you need a colon in front of nameParam? query.setFilter(name == :nameParam); Sydney wrote: The query returns no result. ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment ()); ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(.)) {

[appengine-java] Re: One-to-many querying for a child instance

2010-01-27 Thread Sydney
Since I declared the parameter with query.declareParameters(String nameParam);, the colon is not valid. As expected I got an exception org.datanucleus.store.query.QueryCompilerSyntaxException: Explicit parameters defined for query, yet implicit parameter syntax (:nameParam) found On Jan 27, 4:39 

[appengine-java] Re: One-to-many querying for a child instance

2010-01-27 Thread Sydney
I used an extent to verify that a B with a B name exists. ExtentB e = pm.getExtent(B.class); IteratorB it = e.iterator(); while (it.hasNext()) { B rsb = it.next(); System.out.println(rsb.getName());

Re: [appengine-java] Re: One-to-many querying for a child instance

2010-01-27 Thread Rusty Wright
Yes, as you can surmise, I'm guessing. What's this annotation on the name property for? @Extension(vendorName=datanucleus, key=gae.pk-name, value=true) Sydney wrote: Since I declared the parameter with query.declareParameters(String nameParam);, the colon is not valid. As expected I got an

[appengine-java] Re: One-to-many querying for a child instance

2010-01-26 Thread Sydney
The query returns no result. ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment ()); ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(.)) { }); A a = new A(A); B b = new B(B); a.getBs().add(b);