ScalarType

136 views
Skip to first unread message

Daryl Stultz

unread,
Mar 3, 2010, 8:43:31 PM3/3/10
to Ebean ORM
Hey,

When I do this:

query.where().eq("user.primaryRole", myRole);

I get this:

No ScalarType registered for class ...model.Role

Is it possible to configure Ebean so it works like JPA in this regard?
JPA would do the comparison on the id properties. In this case I could
just do:

query.where().eq("user.primaryRole.id", myRole.getId());

but it would be real handy for an IN clause with a collection of
roles.

Thanks.

/Daryl

Rob Bygrave

unread,
Mar 3, 2010, 9:36:13 PM3/3/10
to eb...@googlegroups.com
> query.where().eq("user.primaryRole", myRole);

Actually this should work for eq for a ManyToOne (but not for in) ... can you post up your code / example.

Thanks, Rob.

Daryl Stultz

unread,
Mar 4, 2010, 9:27:07 PM3/4/10
to Ebean ORM

On Mar 3, 9:36 pm, Rob Bygrave <robin.bygr...@gmail.com> wrote:
> > query.where().eq("user.primaryRole", myRole);
>
> Actually this should work for eq for a ManyToOne (but not for in) ... can
> you post up your code / example.

I actually made up the eq version above, I never tried it. Sorry, bad
example. My case is actually the IN variation.

/Daryl

Daryl Stultz

unread,
Mar 10, 2010, 4:02:29 PM3/10/10
to Ebean ORM

On Mar 3, 9:36 pm, Rob Bygrave <robin.bygr...@gmail.com> wrote:
> > query.where().eq("user.primaryRole", myRole);
>
> Actually this should work for eq for a ManyToOne (but not for in) ...

Ok, can I make a feature request, then? Right now I have to do this:

query.where().in("consultant.id",
IdentifiableUtils.extractIds(consultants));

(IdentifiableUtils.extractIds returns List<Object>, really
List<Integer> in my case)

I'd prefer this:

query.where().in("consultant", consultants);

/Daryl

Rob Bygrave

unread,
Mar 11, 2010, 2:44:02 PM3/11/10
to eb...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages