A simple question: In this example I need to retrieve all objects, but these objects must have distinct msgFrom fields. When I use
List&
Below is the sample query :
select e from Message e where e.msgFrom IN (select distinct m.msgFrom from Message m WHERE m.msgTo = ? AND m.msgCheck = "0");
Alternatively, you can also use Criteria API.