From: Rob Bygrave <robin.bygr...@gmail.com>
Date: Fri, 5 Mar 2010 23:38:36 +1300
Local: Fri, Mar 5 2010 5:38 am
Subject: Re: [ebean] Re: Eager vs Lazy produces different results
Ok, a brain dump wrt ... " find user where validRoles.id in :roleIdList " 1. this can be interpreted 2 ways - a) filter on the parent (JPA) or b) 2. We want to be able to do both (filter on parent or *ToMany) 3. The upside of Ebean's interpretation is that the clause translates 4. People wanting to filter on the parent ... need to recognise the *ToMany However ... - I'm guessing it will be more common for people to want to filter on the - Ebean could make this a lot easier - We need to communicate and explain the issue somehow (the 2 types of - There are a couple of bugs which don't help Query<User> subquery = Ebean.find(User.class).select("id").where().in("validRoles.id",myRoles); Ebean.find(User.class) <<< Given this is a common enough user requirement ... we could make this easier We could for example do... Ebean.find(User.class) I'm not sure about "subquery()" ... I wonder if we can find a better why of Hmmm. On Fri, Mar 5, 2010 at 7:57 PM, Rob Bygrave <robin.bygr...@gmail.com> wrote:
> > " join o.validRoles as vr" > If you get a chance ... can you change this join to a "fetch join"... > I'd suggest the second query is a perhaps a lazy loading query. It is hard > Assuming no columns from t2 are in the select clause of the first query it > > I'm thinking that people (like me) coming from JPA are going to be > Yes. I also think JPQL didn't help with it's need for distinct. You will > To me this is actually coming down to the difference between *ToMany and > I think we want to do both ... and we want to make this as easy for people > On Fri, Mar 5, 2010 at 3:24 PM, Daryl Stultz <kungfumachin...@gmail.com>wrote: >> On Mar 4, 8:07 pm, Rob Bygrave <robin.bygr...@gmail.com> wrote: >> > I'd suggest what you wanted to do was more like: >> > Personally I have a SQL bias and I'd suggest the reason you where >> I've been mulling the whole thing over since my last post and came to >> I'm thinking that people (like me) coming from JPA are going to be >> > That is, when you do the JPA query and see the generated SQL I'd >> Yes that's what I expected to see, and I'm sure I've seen it in some >> User user = setup.insertUser("user1"); >> List<Integer> roleIds = new ArrayList<Integer>(); >> Query query = ExecutionResources.getEntityManager().createQuery( >> List<User> result = query.getResultList(); >> JpaUtils.addFetchFields takes advantage of fetch plan manipulation to >> SELECT DISTINCT t0.userid, ... >> SELECT DISTINCT t0.userid... >> It looks a bit whacky to me, double joining the child tables. Not sure >> > and the question >> Yup, I hear ya. Looks like that's where I'm going... >> > Yup - that is going to be a bug - but firstly I want to get to the >> Just so we're clear, the default join/fetch produces a filtered child >> /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.
| ||||||||||||||