1 package fr.ifremer.dali.dao.administration.user; 2 3 /* 4 * #%L 5 * Dali :: Core 6 * $Id:$ 7 * $HeadURL:$ 8 * %% 9 * Copyright (C) 2014 - 2015 Ifremer 10 * %% 11 * This program is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Affero General Public License as published by 13 * the Free Software Foundation, either version 3 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU Affero General Public License 22 * along with this program. If not, see <http://www.gnu.org/licenses/>. 23 * #L% 24 */ 25 26 import fr.ifremer.dali.dto.referential.DepartmentDTO; 27 import fr.ifremer.quadrige3.core.dao.administration.user.DepartmentDao; 28 import org.springframework.cache.annotation.Cacheable; 29 30 import java.util.List; 31 32 /** 33 * <p>DaliDepartmentDao interface.</p> 34 * 35 */ 36 public interface DaliDepartmentDao extends DepartmentDao { 37 38 /** Constant <code>ALL_DEPARTMENTS_CACHE="allDepartments"</code> */ 39 String ALL_DEPARTMENTS_CACHE = "all_departments"; 40 /** Constant <code>DEPARTMENT_BY_ID_CACHE="departmentById"</code> */ 41 String DEPARTMENT_BY_ID_CACHE = "department_by_id"; 42 /** Constant <code>DEPARTMENTS_BY_IDS_CACHE="departmentsByIds"</code> */ 43 String DEPARTMENTS_BY_IDS_CACHE = "departments_by_ids"; 44 45 /** 46 * <p>getAllDepartments.</p> 47 * 48 * @param statusCodes a {@link java.util.List} object. 49 * @return a {@link java.util.List} object. 50 */ 51 @Cacheable(value = ALL_DEPARTMENTS_CACHE) 52 List<DepartmentDTO> getAllDepartments(List<String> statusCodes); 53 54 /** 55 * <p>getDepartmentById.</p> 56 * 57 * @param departmentId a int. 58 * @return a {@link fr.ifremer.dali.dto.referential.DepartmentDTO} object. 59 */ 60 @Cacheable(value = DEPARTMENT_BY_ID_CACHE) 61 DepartmentDTO getDepartmentById(int departmentId); 62 63 /** 64 * <p>getDepartmentsByIds.</p> 65 * 66 * @param departmentIds a {@link java.util.List} object. 67 * @return a {@link java.util.List} object. 68 */ 69 @Cacheable(value = DEPARTMENTS_BY_IDS_CACHE) 70 List<DepartmentDTO> getDepartmentsByIds(List<Integer> departmentIds); 71 72 /** 73 * <p>findDepartmentsByCodeAndName.</p> 74 * 75 * @param code a {@link java.lang.String} object. 76 * @param name a {@link java.lang.String} object. 77 * @param strictName a boolean. 78 * @param parentId a {@link java.lang.Integer} object. 79 * @param statusCodes a {@link java.util.List} object. 80 * @return a {@link java.util.List} object. 81 */ 82 List<DepartmentDTO> findDepartmentsByCodeAndName(String code, String name, boolean strictName, Integer parentId, List<String> statusCodes); 83 84 }