ItEr50S04ValidacionEProbasFuncionaisItEr49S04: Fixing problem adding and removing order elements without modify them.
This commit is contained in:
parent
1de44e376a
commit
8e18dfeb70
1 changed files with 3 additions and 0 deletions
|
|
@ -364,6 +364,9 @@ public class OrderElementDAO extends GenericDAOHibernate<OrderElement, Long>
|
|||
}
|
||||
|
||||
private boolean isAlreadyInUse(OrderElement orderElement) {
|
||||
if (orderElement.isNewObject()) {
|
||||
return false;
|
||||
}
|
||||
boolean usedInWorkReports = !getSession().createCriteria(
|
||||
WorkReport.class).add(
|
||||
Restrictions.eq("orderElement", orderElement)).list().isEmpty();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue