A U-Bend In The Tubes

Wednesday, July 22, 2009

I hate the Hibernate elements keyword

Not much going on in Bradshaw land at the moment. Working on a whole heap of logically interesting bugs that just use standard-ass java constructs, so there’s not much to update. I just spent an hour shouting at Hibernate over something I really should have known before, but somehow managed to avoid learning.

If you want to do an ‘IN’ query on an object that has a Collection as a field you need to use the “elements” keyword: thus.

SELECT
  foo
FROM
  Foo foo
WHERE
  :bar in elements(foo.barList)

Woo!

posted by Bradshaw at 10:43  

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by WordPress