Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion Eager vs Lazy produces different results
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Daryl Stultz  
View profile  
 More options Mar 7 2010, 2:49 pm
From: Daryl Stultz <kungfumachin...@gmail.com>
Date: Sun, 7 Mar 2010 11:49:45 -0800 (PST)
Local: Sun, Mar 7 2010 2:49 pm
Subject: Re: Eager vs Lazy produces different results

On Mar 7, 2:13 pm, Mario Ivankovits <mario.ivankov...@gmail.com>
wrote:

> Hmmm ... about the filterMany() api.

> In the above statement it is not clear which relation is filtered. If
> you mix filtering *ToMay and Root-Filtering you might get confused.

> At least adding the relation name on filterMany() might be required:

Right, if you did this:

Ebean.find(Customer.class)
     .where()
     .filterMany().eq("orders.status", Order.Status.NEW)
     .startsWith("name", "A")

that would be ambiguous (assuming order.name). Maybe adding the
relation name in filterMany implies a new "namespace" for the paths
under it.

Ebean.find(Customer.class)
     .where()
     .filterMany("orders").eq("status", Order.Status.NEW)
     .startsWith("name", "A")

So status and name are properties of order (not that name makes sense
for an order, but you get my point - "orders" doesn't proceed each
property, they are all relative to the "orders" property of customer.)
I imagine a lot of this will have to do with the implementation
details.

> ... or what about that:

> Query<Customer> custQuery = Ebean.find(Customer.class);
> custQuery.where().startWith("name", "A");

> Query<Order> custOrderQuery = custQuery.findMany("orders",
> Order.class);
> custOrderQuery.where().eg("status", Order.Status.NEW).gt("orderDate",
> lastWeek);

> But this might be too much work, no?

I'm not really clear what the next step for the above is, I'm
expecting to execute one query to get a list of customers with order
collections filtered. Can you show how this would be executed to get
the result? Plus, I'm lazy, too much work. :-)

/Daryl


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.