Author: echatellier Date: 2012-05-04 16:51:40 +0200 (Fri, 04 May 2012) New Revision: 3405 Url: http://chorem.org/repositories/revision/lima/3405 Log: Just another topia query removal Added: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodDAOImpl.java Added: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodDAOImpl.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodDAOImpl.java (rev 0) +++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodDAOImpl.java 2012-05-04 14:51:40 UTC (rev 3405) @@ -0,0 +1,61 @@ +/* + * #%L + * Lima callao + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 CodeLutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +package org.chorem.lima.entity; + +import java.util.List; + +import org.nuiton.topia.TopiaException; + +/** + * Fiscal period entity DAO. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class FiscalPeriodDAOImpl <E extends FiscalPeriod> extends FiscalPeriodDAOAbstract<FiscalPeriod> { + + /** + * Find fiscal period by financial period. + * + * @param financialPeriod financial period + * @return fiscal period containing financial period + * @throws TopiaException + */ + public FiscalPeriod findByFinancialPeriod(FinancialPeriod financialPeriod) throws TopiaException { + String query = "FROM " + FiscalPeriod.class.getName() + + "WHERE :financialPeriod in elements(financialPeriod)"; + + List<FiscalPeriod> fiscalPeriods = context.find(query, "financialPeriod", financialPeriod); + FiscalPeriod result = null; + if (!fiscalPeriods.isEmpty()) { + result = fiscalPeriods.get(0); + } + return result; + } +} Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodDAOImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL
participants (1)
-
echatellier@users.chorem.org