When mapping set associations to an entity, is it possible to map just entry from that set using selection criteria?
Take the following example: a 'Project' entity has a set of 'ProjectStatus' entries. Typically the Project class would include a set of all 'ProjectStatus' entries, as shown in class 'Project1 below...
Code:
public class ProjectStatus {
private Date Changed;
private Status Status;
....
}
public class Project1 {
private String ID;
private String Title;
private Set<ProjectStatus> StatusEntries;
...
}
public class Project2 {
private String ID;
private String Title;
private ProjectStatus CurrentStatus; // the Project Status entry with the most recent 'changed' date
...
}
However, I'm really only interested in the latest 'ProjectStatus' drawn from the set with the most recent 'changed' date. Is it possible to map 'currentStatus' within the Project entity, as shown in 'Project2' above?