ItEr37S12CUAdministracionCategoriaCosteItEr36S14: only active TypesOfWorkHours are listed when creating HourCosts.
This commit is contained in:
parent
9ab5742382
commit
698a43a819
3 changed files with 19 additions and 1 deletions
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
package org.navalplanner.business.costcategories.daos;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.navalplanner.business.common.daos.IGenericDAO;
|
||||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.navalplanner.business.costcategories.entities.TypeOfWorkHours;
|
||||
|
|
@ -36,4 +38,6 @@ public interface ITypeOfWorkHoursDAO extends IGenericDAO<TypeOfWorkHours, Long>
|
|||
throws InstanceNotFoundException;
|
||||
|
||||
boolean existsByCode(TypeOfWorkHours typeOfWorkHours);
|
||||
|
||||
List<TypeOfWorkHours> findActive();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
|
||||
package org.navalplanner.business.costcategories.daos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
|
|
@ -59,6 +62,17 @@ public class TypeOfWorkHoursDAO extends GenericDAOHibernate<TypeOfWorkHours, Lon
|
|||
return found;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypeOfWorkHours> findActive() {
|
||||
|
||||
Criteria c = getSession().createCriteria(TypeOfWorkHours.class);
|
||||
c.add(Restrictions.eq("enabled", true));
|
||||
|
||||
List<TypeOfWorkHours> list = new ArrayList<TypeOfWorkHours>();
|
||||
list.addAll(c.list());
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsByCode(TypeOfWorkHours typeOfWorkHours) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class TypeOfWorkHoursFinder extends Finder implements IFinder {
|
|||
|
||||
@Transactional(readOnly = true)
|
||||
public List<TypeOfWorkHours> getAll() {
|
||||
return dao.list(TypeOfWorkHours.class);
|
||||
return dao.findActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue