ItEr49S18AdaptacionServiciosREST: Changed CriterionDTO to create its inner Criterion object as soon as possible.

It's needed for the code to be generated from the first moment so we can show it for new Criteria.
This commit is contained in:
Jacobo Aragunde Pérez 2010-03-05 21:11:41 +01:00 committed by Javier Moran Rua
parent 51ceaf21a5
commit 6da7f3113a

View file

@ -119,6 +119,8 @@ public class CriterionTreeModel implements ICriterionTreeModel{
private CriterionDTO createNewCriterion(String name) {
CriterionDTO newCriterion = new CriterionDTO();
newCriterion.setName(_(name));
Criterion criterion = Criterion.create(criterionType);
newCriterion.setCriterion(criterion);
return newCriterion;
}
@ -409,10 +411,6 @@ public class CriterionTreeModel implements ICriterionTreeModel{
private void updateDataCriterion(CriterionDTO criterionDTO){
Criterion criterion = criterionDTO.getCriterion();
if(criterion == null){
criterion = Criterion.create(criterionType);
criterionDTO.setCriterion(criterion);
}
criterion.setName(criterionDTO.getName());
criterion.setActive(criterionDTO.isActive());
}