Yes, it is a replacement for Datanucleus designed specifically for the
datastore. There are also other alternative frameworks such as Slim3,
Objectify and SimpleDS all with their own unique features.
Twig is the only one to support these merged OR queries you asked about.
One more point - Twig executes the two branches of the OR query in
*parallel* and then merges the results. It can do this because it has
support for async (non-blocking) datastore operations. this means
that even if you have hundreds of branches to your query they should
return in roughly the same amount of time.
On 15 Jul 2010, at 13:52, Vikas Hazrati wrote:
Hi John, I quickly skimmed over the twig project, it seems that it
works directly on top of the datastore. Does that mean that I do not
need to use datanucleus or does twig work in conjunction with that and
I would need both.
On Jul 14, 9:30 pm, John Patterson <[email protected]> wrote:
Twig Persist has support for OR queries on multiple properties.
http://code.google.com/p/twig-persist/
You example is coded like this:
TypedFindCommand command =
datastore.find().type(Person.class).addFilter)"active",
EQUAL, true);
command.addChildQuery().addFilter("firstName", EQUAL, aFirstName);
command.addChildQuery().addFilter("lastName", EQUAL, aLastName);
Iterator<Person> people = command.returnResultsNow();
On 14 Jul 2010, at 19:10, Vikas Hazrati wrote:
Further to my previous question
http://groups.google.com/group/google-appengine/browse_thread/
thread/...
in which we were getting the following error ....
'or' filters can only check equality
Now for the sake of datanucleus and datastore we changed the
functionality to be equality for the time being
so the query reads like
@NamedQuery(name="User.findActiveByUsernamePattern",
query="SELECT DISTINCT user " +
"FROM User as user " +
"WHERE (firstName = :pattern OR
lastName = :pattern) " +
"AND (active = true) " +
"ORDER BY firstName, lastName")
and now I get
org.datanucleus.store.appengine.query.DatastoreQuery
$UnsupportedDatastoreFeatureException: Problem with query <SELECT
FROM
User as user WHERE (user.firstName = :pattern OR user.lastName
= :pattern) AND (user.active = true) ORDER BY user.firstName,
user.lastName>: Or filters cannot be applied to multiple properties
(found both firstName and lastName).
A search on the net does not show too many results for the problem
that we are facing.
Are we the only ones facing this issue? No one else is trying to
port
a legacy application to GAE????? Isn't this quite a normal routine
query in JPA???
@datanucleus, @gae please respond.
Regards | Vikas
www.inphina.com
www.thoughts.inphina.com
--
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 [email protected]
.
To unsubscribe from this group, send email to
[email protected]
.
For more options, visit this group
athttp://groups.google.com/group/google-appengine-java?hl=en
.
--
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 [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-java?hl=en
.
--
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 [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-java?hl=en.