--- /dev/null
+/**
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library 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 Lesser General Public License for more
+ * details.
+ */
+
+package com.pentila.entSavoie.serviceManager.service.impl;
+
+import java.util.List;
+
+import com.liferay.portal.kernel.exception.SystemException;
+import com.pentila.entSavoie.serviceManager.NoSuchServicePopulationException;
+import com.pentila.entSavoie.serviceManager.model.ServicePopulation;
+import com.pentila.entSavoie.serviceManager.service.base.ServicePopulationLocalServiceBaseImpl;
+
+/**
+ * The implementation of the service population local service.
+ *
+ * <p>
+ * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link com.pentila.entSavoie.serviceManager.service.ServicePopulationLocalService} interface.
+ *
+ * <p>
+ * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
+ * </p>
+ *
+ * @author Harifetra Ramamonjy
+ * @see com.pentila.entSavoie.serviceManager.service.base.ServicePopulationLocalServiceBaseImpl
+ * @see com.pentila.entSavoie.serviceManager.service.ServicePopulationLocalServiceUtil
+ */
+public class ServicePopulationLocalServiceImpl
+ extends ServicePopulationLocalServiceBaseImpl {
+ public ServicePopulation addServicePopulation() throws SystemException {
+ final long servicePopulationId = counterLocalService.increment();
+ return servicePopulationPersistence.create(servicePopulationId);
+ }
+
+ public boolean addServicePopulation(long populationId, long serviceId,long etabId) throws SystemException {
+ ServicePopulation servicePopulation = addServicePopulation();
+ servicePopulation.setPopulationId(populationId);
+ servicePopulation.setServiceId(serviceId);
+ servicePopulation.setEtabId(etabId);
+ servicePopulationPersistence.update(servicePopulation, false);
+ return true;
+ }
+
+ public boolean deleteServicePopulation(long populationId, long serviceId)
+ throws NoSuchServicePopulationException, SystemException {
+ servicePopulationPersistence.removeByServicePopulation_serviceId_populationId(serviceId, populationId);
+ return true;
+ }
+
+ public List<ServicePopulation> findByServiceId(long serviceId) throws SystemException {
+ return servicePopulationPersistence.findByServicePopulation_serviceId(serviceId);
+ }
+
+ public boolean deleteServicePopulationByServiceId(long serviceId)
+ throws NoSuchServicePopulationException, SystemException {
+ servicePopulationPersistence.removeByServicePopulation_serviceId(serviceId);
+ return true;
+ }
+
+ public boolean deleteServicePopulationByPopulationId(long populationId)
+ throws NoSuchServicePopulationException, SystemException {
+ servicePopulationPersistence.removeByServicePopulation_populationId(populationId);
+ return true;
+ }
+
+ public ServicePopulation findByServiceIdEtabId(long serviceId, long etabId) throws SystemException {
+ return servicePopulationPersistence.fetchByServicePopulation_serviceId_etabId(serviceId, etabId);
+ }
+
+}
\ No newline at end of file