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
 
Mario Ivankovits  
View profile  
 More options Mar 7 2010, 2:13 pm
From: Mario Ivankovits <mario.ivankov...@gmail.com>
Date: Sun, 7 Mar 2010 11:13:10 -0800 (PST)
Local: Sun, Mar 7 2010 2:13 pm
Subject: Re: Eager vs Lazy produces different results
Hi!

> Daryl, Mario ... are you happy to go with Option 2 ?

Yep, 2 seems good to me!

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

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:

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

... 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?

Ciao,
Mario


 
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.