ItEr57S04ValidacionEProbasFuncionaisItEr56S04: Apply validation annotations on methods instead of fields.
A validation annotation on a field was causing a validation error when saving limiting resources (the entity was a proxy).
This commit is contained in:
parent
a53e99acac
commit
c6332e37d5
2 changed files with 13 additions and 3 deletions
|
|
@ -101,9 +101,14 @@ public class GenericResourceAllocation extends
|
|||
@OnCopy(Strategy.SHARE_COLLECTION_ELEMENTS)
|
||||
private Set<Criterion> criterions = new HashSet<Criterion>();
|
||||
|
||||
@Valid
|
||||
private Set<GenericDayAssignmentsContainer> genericDayAssignmentsContainers = new HashSet<GenericDayAssignmentsContainer>();
|
||||
|
||||
@Valid
|
||||
private Set<GenericDayAssignmentsContainer> getGenericDayAssignmentsContainers() {
|
||||
return new HashSet<GenericDayAssignmentsContainer>(
|
||||
genericDayAssignmentsContainers);
|
||||
}
|
||||
|
||||
@OnCopy(Strategy.IGNORE)
|
||||
private Map<Resource, List<GenericDayAssignment>> orderedDayAssignmentsByResource = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -82,13 +82,17 @@ public class SpecificResourceAllocation extends
|
|||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@OnCopy(Strategy.SHARE)
|
||||
private Resource resource;
|
||||
|
||||
@Valid
|
||||
private Set<SpecificDayAssignmentsContainer> specificDayAssignmentsContainers = new HashSet<SpecificDayAssignmentsContainer>();
|
||||
|
||||
@Valid
|
||||
private Set<SpecificDayAssignmentsContainer> getSpecificDayAssignmentsContainers() {
|
||||
return new HashSet<SpecificDayAssignmentsContainer>(
|
||||
specificDayAssignmentsContainers);
|
||||
}
|
||||
|
||||
public static SpecificResourceAllocation createForTesting(
|
||||
ResourcesPerDay resourcesPerDay, Task task) {
|
||||
return create(new SpecificResourceAllocation(
|
||||
|
|
@ -134,6 +138,7 @@ public class SpecificResourceAllocation extends
|
|||
return new TransientState(new HashSet<SpecificDayAssignment>());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Resource getResource() {
|
||||
return resource;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue