ItEr29S16CUCreacionProxectoCategorizacionTraballoItEr10S11: Not allow create orders with initDate null.

This commit is contained in:
Manuel Rego Casasnovas 2009-10-08 12:20:29 +02:00 committed by Javier Moran Rua
parent 09ac30af47
commit 174f82e16b

View file

@ -21,6 +21,7 @@
package org.navalplanner.business.orders.entities;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@ -101,6 +102,10 @@ public class Order extends OrderLineGroup implements IValidable {
@Override
public void checkValid() throws ValidationException {
if (this.getInitDate() == null) {
throw new ValidationException("initDate must not be null");
}
if (this.isEndDateBeforeStart()) {
throw new ValidationException("endDate must be after startDate");
}