Hello,
I've two object, Risk and action. Actually Risk(id, summary, list<Action> actionsList) contains a list of actions(id, dueDate)
I would like to create a request using criteria in order to retrieve only risks which contains one or more actions with a specific due date.
I don't know how can I point the dueDate in the criteria, smthing like that:
Code:
criteria = criteria.add(Restrictions.le("actions.duetDate", date));
can someone help me on this?
thx :-)
I got the response:
Code:
List<Risk> riskList =
session.createCriteria(Risk.class)
.createAlias("actions", "action")
.add(Restrictions.eq("action.dueDate", date))
.add(Restrictions.ne("action.status", "100%"))
.addOrder(Order.asc("action.dueDate"))
.list();