This discussion is archived
0 Replies Latest reply: Aug 7, 2012 7:34 PM by 859967 RSS

concat expression<Collection<T>>

859967 Newbie
Currently Being Moderated
Hi all,

I have a mapping in my entity, one to many mapping, example relationship "1 question -> many answers"

so, in Question class, i can access a collection of "Answers"; But in my criteria query, i need to concat all "Answers' summary" for sorting purpose. ("summary" is a field in Answer class)

I can get:
  Expression<Collection<T>> e = root.get("answers") 
but i don't know how to create sorting criteria for concatenation of all summary that an answer has.

I have googled around, but i haven't found a way to do it.

thank you for your help

regards,

-Hoang Long

Edited by: CardM on Aug 7, 2012 7:34 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points