Franciaflex-magalie-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 438 discussions
r193 - in branches/magalie-eugene: magalie-persistence magalie-persistence/src/main/java/com/franciaflex/magalie/persistence magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity magalie-persistence/src/main/xmi magalie-services magalie-services/src/test/java/com/franciaflex/magalie/services
by tchemit@users.forge.codelutin.com 25 May '13
by tchemit@users.forge.codelutin.com 25 May '13
25 May '13
Author: tchemit
Date: 2013-05-25 16:34:59 +0200 (Sat, 25 May 2013)
New Revision: 193
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
use nuiton-jpa
Added:
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseJpaDao.java
Removed:
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Entities.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaUtil.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/Dao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/AbstractEntity.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Building.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedList.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedListStatus.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Kanban.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/LocationError.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/MagalieUser.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/PreparedArticleReception.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/RequestedArticle.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/RequestedList.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StoredArticle.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Supplier.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/UnavailableArticle.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Warehouse.java
branches/magalie-eugene/magalie-services/src/test/java/com/franciaflex/magalie/services/JpaEntityManagerRule.java
Modified:
branches/magalie-eugene/magalie-persistence/pom.xml
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaMagaliePersistenceContext.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Locations.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/RequestedArticles.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Article.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedArticle.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Location.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StorageMovement.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StorageMovementOrder.java
branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties
branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.zargo
branches/magalie-eugene/magalie-services/pom.xml
branches/magalie-eugene/magalie-services/src/test/java/com/franciaflex/magalie/services/AbstractMagalieServiceTest.java
Modified: branches/magalie-eugene/magalie-persistence/pom.xml
===================================================================
--- branches/magalie-eugene/magalie-persistence/pom.xml 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/pom.xml 2013-05-25 14:34:59 UTC (rev 193)
@@ -25,11 +25,6 @@
</dependency>
<dependency>
- <groupId>org.nuiton.jpa</groupId>
- <artifactId>nuiton-jpa-junit</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
</dependency>
@@ -110,9 +105,9 @@
<phase>generate-sources</phase>
<configuration>
<!-- Corresponding to extracted package from zargo file -->
- <fullPackagePath>com.franciaflex.magalie.persistence.entities</fullPackagePath>
- <!-- DefaultPackage used for DAOHelper generation -->
- <defaultPackage>com.franciaflex.magalie.persistence.entities</defaultPackage>
+ <fullPackagePath>com.franciaflex.magalie.persistence.entity</fullPackagePath>
+ <!-- defaultPackage used for generation -->
+ <defaultPackage>com.franciaflex.magalie.persistence</defaultPackage>
<templates>
org.nuiton.jpa.templates.JpaEntityTransformer,
org.nuiton.jpa.templates.JpaDaoTransformer,
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Entities.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Entities.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Entities.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,66 +0,0 @@
-package com.franciaflex.magalie.persistence;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.AbstractEntity;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import org.apache.commons.lang3.ObjectUtils;
-
-import java.util.Comparator;
-
-public class Entities {
-
- private Entities() {}
-
- protected static class GetIdFunction implements Function<AbstractEntity, String> {
-
- @Override
- public String apply(AbstractEntity entity) {
- return entity.getId();
- }
- }
-
- protected static class ArbitraryComparator<E extends AbstractEntity> implements Comparator<E> {
-
- @Override
- public int compare(E x, E y) {
- return ObjectUtils.compare(x.getId(), y.getId());
- }
-
- }
-
- public static Function<AbstractEntity, String> getIdFunction() {
- return new GetIdFunction();
- }
-
- public static Predicate<AbstractEntity> entityHasId(String id) {
- return Predicates.compose(Predicates.equalTo(id), getIdFunction());
- }
-
- public static <E extends AbstractEntity> Comparator<E> arbitraryComparator() {
- return new ArbitraryComparator();
- }
-}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaMagaliePersistenceContext.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaMagaliePersistenceContext.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaMagaliePersistenceContext.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -23,161 +23,21 @@
* #L%
*/
-import com.franciaflex.magalie.persistence.dao.ArticleDao;
-import com.franciaflex.magalie.persistence.dao.BuildingDao;
-import com.franciaflex.magalie.persistence.dao.DeliveredRequestedArticleDao;
-import com.franciaflex.magalie.persistence.dao.DeliveredRequestedListDao;
-import com.franciaflex.magalie.persistence.dao.KanbanDao;
-import com.franciaflex.magalie.persistence.dao.MagalieUserDao;
-import com.franciaflex.magalie.persistence.dao.PreparedArticleReceptionDao;
-import com.franciaflex.magalie.persistence.dao.RequestedArticleDao;
-import com.franciaflex.magalie.persistence.dao.LocationDao;
-import com.franciaflex.magalie.persistence.dao.LocationErrorDao;
-import com.franciaflex.magalie.persistence.dao.RequestedListDao;
-import com.franciaflex.magalie.persistence.dao.StorageMovementDao;
-import com.franciaflex.magalie.persistence.dao.StorageMovementOrderDao;
-import com.franciaflex.magalie.persistence.dao.SupplierDao;
-import com.franciaflex.magalie.persistence.dao.UnavailableArticleDao;
-import com.franciaflex.magalie.persistence.dao.WarehouseDao;
-import com.franciaflex.magalie.persistence.dao.StoredArticleDao;
-import com.franciaflex.magalie.persistence.dao.jpa.ArticleJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.BuildingJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.DeliveredRequestedArticleJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.DeliveredRequestedListJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.KanbanJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.LocationErrorJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.LocationJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.MagalieUserJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.PreparedArticleReceptionJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.RequestedArticleJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.RequestedListJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.StorageMovementJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.StorageMovementOrderJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.SupplierJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.UnavailableArticleJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.WarehouseJpaDao;
-import com.franciaflex.magalie.persistence.dao.jpa.StoredArticleJpaDao;
+import org.nuiton.jpa.api.hibernate.HibernateUtil;
import javax.persistence.EntityManager;
-import javax.persistence.EntityTransaction;
-public class JpaMagaliePersistenceContext implements MagaliePersistenceContext {
+public class JpaMagaliePersistenceContext extends AbstractJpaMagaliePersistenceContext implements MagaliePersistenceContext {
- protected EntityManager entityManager;
-
- protected EntityTransaction entityTransaction;
-
public JpaMagaliePersistenceContext(EntityManager entityManager) {
- this.entityManager = entityManager;
- entityTransaction = entityManager.getTransaction();
- if ( ! entityTransaction.isActive()) {
- entityTransaction.begin();
- }
+ super(entityManager);
}
@Override
- public void commit() {
- entityTransaction.commit();
- entityTransaction = entityManager.getTransaction();
- entityTransaction.begin();
- }
-
- @Override
- public void rollback() {
- entityTransaction.rollback();
- entityTransaction = entityManager.getTransaction();
- entityTransaction.begin();
- }
-
- @Override
public void clearDatabase() {
rollback();
- JpaUtil.cleanDatabase(entityManager);
+ HibernateUtil.cleanDatabase(entityManager);
commit();
}
- @Override
- public MagalieUserDao getMagalieUserDao() {
- return new MagalieUserJpaDao(entityManager);
- }
-
- @Override
- public StoredArticleDao getStoredArticleDao() {
- return new StoredArticleJpaDao(entityManager);
- }
-
- @Override
- public RequestedArticleDao getRequestedArticleDao() {
- return new RequestedArticleJpaDao(entityManager);
- }
-
- @Override
- public ArticleDao getArticleDao() {
- return new ArticleJpaDao(entityManager);
- }
-
- @Override
- public StorageMovementDao getStorageMovementDao() {
- return new StorageMovementJpaDao(entityManager);
- }
-
- @Override
- public LocationErrorDao getLocationErrorDao() {
- return new LocationErrorJpaDao(entityManager);
- }
-
- @Override
- public StorageMovementOrderDao getStorageMovementOrderDao() {
- return new StorageMovementOrderJpaDao(entityManager);
- }
-
- @Override
- public LocationDao getLocationDao() {
- return new LocationJpaDao(entityManager);
- }
-
- @Override
- public DeliveredRequestedArticleDao getDeliveredRequestedArticleDao() {
- return new DeliveredRequestedArticleJpaDao(entityManager);
- }
-
- @Override
- public WarehouseDao getWarehouseDao() {
- return new WarehouseJpaDao(entityManager);
- }
-
- @Override
- public BuildingDao getBuildingDao() {
- return new BuildingJpaDao(entityManager);
- }
-
- @Override
- public RequestedListDao getRequestedListDao() {
- return new RequestedListJpaDao(entityManager);
- }
-
- @Override
- public DeliveredRequestedListDao getDeliveredRequestedListDao() {
- return new DeliveredRequestedListJpaDao(entityManager);
- }
-
- @Override
- public KanbanDao getKanbanDao() {
- return new KanbanJpaDao(entityManager);
- }
-
- @Override
- public SupplierDao getSupplierDao() {
- return new SupplierJpaDao(entityManager);
- }
-
- @Override
- public UnavailableArticleDao getUnavailableArticleDao() {
- return new UnavailableArticleJpaDao(entityManager);
- }
-
- @Override
- public PreparedArticleReceptionDao getPreparedArticleReceptionDao() {
- return new PreparedArticleReceptionJpaDao(entityManager);
- }
-}
+} //JpaMagaliePersistenceContext
\ No newline at end of file
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaUtil.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaUtil.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaUtil.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,139 +0,0 @@
-package com.franciaflex.magalie.persistence;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-import org.apache.commons.lang3.SystemUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-import org.hibernate.ejb.AvailableSettings;
-import org.hibernate.ejb.EntityManagerFactoryImpl;
-import org.hibernate.service.ServiceRegistry;
-import org.hibernate.service.internal.SessionFactoryServiceRegistryImpl;
-import org.hibernate.tool.hbm2ddl.SchemaExport;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import java.io.File;
-import java.lang.reflect.Field;
-import java.util.Collections;
-import java.util.Map;
-
-public class JpaUtil {
-
- private static final Log log = LogFactory.getLog(JpaUtil.class);
-
- protected static final ImmutableMap<String, String> JPA_H2_CONFIG =
- ImmutableMap.of(
- AvailableSettings.JDBC_DRIVER, org.h2.Driver.class.getName(),
- AvailableSettings.JDBC_USER, "sa",
- AvailableSettings.JDBC_PASSWORD, "",
- Environment.DIALECT, org.hibernate.dialect.H2Dialect.class.getName(),
- Environment.HBM2DDL_AUTO, "create"
- );
-
- private JpaUtil() {}
-
- public static EntityManagerFactory createTempEntityManagerFactory(String persistenceUnitName, String context) {
-
- EntityManagerFactory tempEntityManagerFactory =
- createTempEntityManagerFactory(
- persistenceUnitName,
- context, Collections.<String, String>emptyMap());
-
- return tempEntityManagerFactory;
-
- }
-
- public static EntityManagerFactory createTempEntityManagerFactory(String persistenceUnitName, String context, Map<String, String> jpaParameters) {
-
- Map<String, String> allJpaParameters = Maps.newHashMap();
-
- allJpaParameters.putAll(jpaParameters);
-
- allJpaParameters.putAll(JPA_H2_CONFIG);
-
- File tempDirFile = SystemUtils.getJavaIoTmpDir();
-
- File databaseFile = new File(tempDirFile, context);
-
- String h2dataPath = databaseFile.getAbsolutePath() + File.separator + "h2data";
-
- String jdbcUrl = "jdbc:h2:file:" + h2dataPath;
-
- allJpaParameters.put(AvailableSettings.JDBC_URL, jdbcUrl);
-
- if (log.isTraceEnabled()) {
- log.trace("will store H2 data in " + h2dataPath);
- log.trace("jdbc url is\n" + jdbcUrl);
- log.trace("allJpaParameters = " + allJpaParameters);
- }
-
- EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName, allJpaParameters);
-
- return entityManagerFactory;
-
- }
-
- public static void cleanDatabase(EntityManager entityManager) {
-
- if (log.isInfoEnabled()) {
- log.info("will clean database");
- }
-
- ServiceRegistry serviceRegistry =
- ((EntityManagerFactoryImpl) entityManager.getEntityManagerFactory())
- .getSessionFactory().getServiceRegistry();
-
- Configuration configuration = null;
- try {
- Field configurationField = SessionFactoryServiceRegistryImpl.class.getDeclaredField("configuration");
- configurationField.setAccessible(true);
- configuration = (Configuration) configurationField.get(serviceRegistry);
- } catch (IllegalAccessException e) {
- if (log.isErrorEnabled()) {
- log.error("should not occur", e);
- }
- } catch (NoSuchFieldException e) {
- if (log.isErrorEnabled()) {
- log.error("should not occur", e);
- }
- }
-
- SchemaExport schemaExport= new SchemaExport(serviceRegistry, configuration);
-
- schemaExport.setHaltOnError(true);
-
- // drop
- schemaExport.execute(true, true, true, false);
-
- // create
- schemaExport.execute(true, true, false, true);
-
- }
-}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Locations.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Locations.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Locations.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -71,7 +71,9 @@
@Override
public int compare(Location location1, Location location2) {
- return Integer.compare(location2.getRequiredAccreditationLevel(), location1.getRequiredAccreditationLevel());
+ return location2.getRequiredAccreditationLevel() - location1.getRequiredAccreditationLevel();
+ //FIXME Jdk 1.7
+// return Integer.compare(location2.getRequiredAccreditationLevel(), location1.getRequiredAccreditationLevel());
}
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/RequestedArticles.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/RequestedArticles.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/RequestedArticles.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -28,6 +28,7 @@
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
+import org.nuiton.jpa.api.JpaEntities;
import java.util.Comparator;
import java.util.List;
@@ -56,7 +57,7 @@
new RequestedListComparator(RequestedLists.comparator(requests, affectedRequestedList)),
// we can still have ambiguous or priorities, so to be deterministic, use arbitrary order
- Entities.<RequestedArticle>arbitraryComparator()
+ JpaEntities.<RequestedArticle>arbitraryComparator()
)
);
return comparator;
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -24,11 +24,12 @@
*/
import com.franciaflex.magalie.persistence.entity.Article;
+import org.nuiton.jpa.api.JpaDao;
/**
* @author bleny
*/
-public interface ArticleDao extends Dao<Article> {
+public interface ArticleDao extends JpaDao<Article> {
Article findByCode(String articleCode);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/ArticleJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,43 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Article;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class ArticleJpaDao extends AbstractArticleJpaDao<Article> implements ArticleDao {
+
+ public ArticleJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public Article findByCode(String articleCode) {
+ TypedQuery<Article> query = createQuery("from Article a where a.code = :code");
+ query.setParameter(Article.PROPERTY_CODE, articleCode);
+ return findUniqueOrNull(query);
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -24,10 +24,11 @@
*/
import com.franciaflex.magalie.persistence.entity.Building;
+import org.nuiton.jpa.api.JpaDao;
/**
* @author bleny
*/
-public interface BuildingDao extends Dao<Building> {
+public interface BuildingDao extends JpaDao<Building> {
}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/Dao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/Dao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/Dao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,44 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.AbstractEntity;
-
-import java.util.List;
-
-public interface Dao<E extends AbstractEntity> {
-
- E findById(String id);
-
- List<E> findAll();
-
- void persist(E entity);
-
- E merge(E entity);
-
- void remove(E entity);
-
- boolean contains(E entity);
-
-}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,13 +26,14 @@
import com.franciaflex.magalie.persistence.entity.DeliveredRequestedArticle;
import com.franciaflex.magalie.persistence.entity.RequestedList;
import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
/**
* @author bleny
*/
-public interface DeliveredRequestedArticleDao extends Dao<DeliveredRequestedArticle> {
+public interface DeliveredRequestedArticleDao extends JpaDao<DeliveredRequestedArticle> {
DeliveredRequestedArticle find(StorageMovementOrder storageMovementOrder);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/DeliveredRequestedArticleJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,57 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.DeliveredRequestedArticle;
+import com.franciaflex.magalie.persistence.entity.RequestedList;
+import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class DeliveredRequestedArticleJpaDao extends AbstractDeliveredRequestedArticleJpaDao<DeliveredRequestedArticle> implements DeliveredRequestedArticleDao{
+
+ public DeliveredRequestedArticleJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public DeliveredRequestedArticle find(StorageMovementOrder storageMovementOrder) {
+ TypedQuery<DeliveredRequestedArticle> query =
+ entityManager.createQuery(
+ "from DeliveredRequestedArticle dra where dra.storageMovementOrder = :storageMovementOrder", getEntityClass());
+ query.setParameter("storageMovementOrder", storageMovementOrder);
+ return findUniqueOrNull(query);
+ }
+
+ @Override
+ public List<DeliveredRequestedArticle> findAll(RequestedList requestedList) {
+ TypedQuery<DeliveredRequestedArticle> query =
+ entityManager.createQuery(
+ "from DeliveredRequestedArticle dra where dra.requestedArticle.requestedList = :requestedList", getEntityClass());
+ query.setParameter("requestedList", requestedList);
+ return findAll(query);
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,11 +26,12 @@
import com.franciaflex.magalie.persistence.entity.DeliveredRequestedList;
import com.franciaflex.magalie.persistence.entity.MagalieUser;
import com.franciaflex.magalie.persistence.entity.RequestedList;
+import org.nuiton.jpa.api.JpaDao;
/**
* @author bleny
*/
-public interface DeliveredRequestedListDao extends Dao<DeliveredRequestedList> {
+public interface DeliveredRequestedListDao extends JpaDao<DeliveredRequestedList> {
DeliveredRequestedList findByAffectedTo(MagalieUser affectedTo);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/DeliveredRequestedListJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,65 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.DeliveredRequestedList;
+import com.franciaflex.magalie.persistence.entity.DeliveredRequestedListStatus;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.RequestedList;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class DeliveredRequestedListJpaDao extends AbstractDeliveredRequestedListJpaDao<DeliveredRequestedList> implements DeliveredRequestedListDao{
+
+ public DeliveredRequestedListJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public DeliveredRequestedList findByAffectedTo(MagalieUser affectedTo) {
+
+ TypedQuery<DeliveredRequestedList> query = createQuery(
+ "from DeliveredRequestedList drl where drl.status = :affected and drl.affectedTo = :affectedTo");
+
+ query.setParameter("affectedTo", affectedTo);
+
+ query.setParameter("affected", DeliveredRequestedListStatus.AFFECTED);
+
+ return findUniqueOrNull(query);
+
+ }
+
+ @Override
+ public DeliveredRequestedList findByRequestedList(RequestedList requestedList) {
+
+ TypedQuery<DeliveredRequestedList> query = createQuery(
+ "from DeliveredRequestedList drl where drl.requestedList = :requestedList");
+
+ query.setParameter("requestedList", requestedList);
+
+ return findUniqueOrNull(query);
+
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,11 +26,12 @@
import com.franciaflex.magalie.persistence.entity.Article;
import com.franciaflex.magalie.persistence.entity.Kanban;
import com.franciaflex.magalie.persistence.entity.Warehouse;
+import org.nuiton.jpa.api.JpaDao;
/**
* @author bleny
*/
-public interface KanbanDao extends Dao<Kanban> {
+public interface KanbanDao extends JpaDao<Kanban> {
public Kanban find(Article article, Warehouse warehouse);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/KanbanJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,46 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Kanban;
+import com.franciaflex.magalie.persistence.entity.Warehouse;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class KanbanJpaDao extends AbstractKanbanJpaDao<Kanban> implements KanbanDao{
+
+ public KanbanJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public Kanban find(Article article, Warehouse warehouse) {
+ TypedQuery<Kanban> query = entityManager.createQuery("from Kanban k where k.article = :article and k.warehouse = :warehouse", getEntityClass());
+ query.setParameter("article", article);
+ query.setParameter("warehouse", warehouse);
+ return query.getSingleResult();
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,10 +26,11 @@
import com.franciaflex.magalie.persistence.entity.Building;
import com.franciaflex.magalie.persistence.entity.Location;
import com.franciaflex.magalie.persistence.entity.Warehouse;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
-public interface LocationDao extends Dao<Location> {
+public interface LocationDao extends JpaDao<Location> {
Location find(String code, Warehouse warehouse);
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,13 +26,14 @@
import com.franciaflex.magalie.persistence.entity.Article;
import com.franciaflex.magalie.persistence.entity.Location;
import com.franciaflex.magalie.persistence.entity.LocationError;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
/**
* @author bleny
*/
-public interface LocationErrorDao extends Dao<LocationError> {
+public interface LocationErrorDao extends JpaDao<LocationError> {
LocationError findByLocation(Location location);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/LocationErrorJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,62 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Location;
+import com.franciaflex.magalie.persistence.entity.LocationError;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class LocationErrorJpaDao extends AbstractLocationErrorJpaDao<LocationError> implements LocationErrorDao{
+
+ public LocationErrorJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public LocationError findByLocation(Location location) {
+ TypedQuery<LocationError> query = createQuery("from LocationError se where se.location = :location");
+ query.setParameter("location", location);
+ return findUniqueOrNull(query);
+ }
+
+ @Override
+ public List<Location> getAllLocationsInError(Article article) {
+ Query query = entityManager.createQuery("select se.location from LocationError se where se.article = :article");
+ query.setParameter("article", article);
+ List<Location> allLocationsInError = query.getResultList();
+ return allLocationsInError;
+ }
+
+ @Override
+ public List<LocationError> findAll() {
+ Query query = entityManager.createQuery("from LocationError se order by se.reportDate");
+ List<LocationError> all = query.getResultList();
+ return all;
+ }
+}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/LocationJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,84 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.Location;
+import com.franciaflex.magalie.persistence.entity.Warehouse;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class LocationJpaDao extends AbstractLocationJpaDao<Location> implements LocationDao {
+
+ public LocationJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public Location find(String code, Warehouse warehouse) {
+ TypedQuery<Location> query = createQuery("from Location l where l.code = :code and l.warehouse = :warehouse");
+ query.setParameter("code", code);
+ query.setParameter("warehouse", warehouse);
+ return findUnique(query);
+ }
+
+ protected List<Location> findAllWithoutReception(Building building, Warehouse warehouse) {
+ boolean filterOnBuilding = building != null;
+ boolean filterOnWarehouse = warehouse != null;
+ String hql = " from Location l where";
+ if (filterOnBuilding) {
+ hql += " l.warehouse.building = :building and ";
+ }
+ if (filterOnWarehouse) {
+ hql += " l.warehouse = :warehouse and ";
+ }
+ hql += " l.code != :codeForReceptionLocations and "
+ + " l.code != :codeForWarehouseWithoutLocations and "
+ + " l.fullLocation = false "
+ + " order by l.warehouse.building.code, l.warehouse.code, l.code";
+ TypedQuery<Location> query = createQuery(hql);
+ if (filterOnBuilding) {
+ query.setParameter("building", building);
+ }
+ if (filterOnWarehouse) {
+ query.setParameter("warehouse", warehouse);
+ }
+ query.setParameter("codeForReceptionLocations", Locations.codeForReceptionLocations());
+ query.setParameter("codeForWarehouseWithoutLocations", Locations.codeForWarehouseWithoutLocations());
+ return findAll(query);
+ }
+
+ @Override
+ public List<Location> findAllWithoutReception(Building building) {
+ return findAllWithoutReception(building, null);
+ }
+
+ @Override
+ public List<Location> findAllWithoutReception(Warehouse warehouse) {
+ return findAllWithoutReception(null, warehouse);
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -24,13 +24,14 @@
*/
import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
/**
* @author bleny
*/
-public interface MagalieUserDao extends Dao<MagalieUser> {
+public interface MagalieUserDao extends JpaDao<MagalieUser> {
MagalieUser findByLogin(String login);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/MagalieUserJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,52 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class MagalieUserJpaDao extends AbstractMagalieUserJpaDao<MagalieUser> implements MagalieUserDao {
+
+ public MagalieUserJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public MagalieUser findByLogin(String login) {
+ TypedQuery<MagalieUser> query = createQuery("from MagalieUser mu where mu.login = :login");
+ query.setParameter("login", login);
+ return findUnique(query);
+ }
+
+ @Override
+ public List<MagalieUser> findAll() {
+ Query query = entityManager.createQuery("from MagalieUser mu order by mu.login");
+ List<MagalieUser> resultList = query.getResultList();
+ return resultList;
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,11 +1,12 @@
package com.franciaflex.magalie.persistence.dao;
import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
+import org.nuiton.jpa.api.JpaDao;
/**
* @author bleny
*/
-public interface PreparedArticleReceptionDao extends Dao<PreparedArticleReception> {
+public interface PreparedArticleReceptionDao extends JpaDao<PreparedArticleReception> {
PreparedArticleReception findByBarcode(String barcode);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/PreparedArticleReceptionJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,20 @@
+package com.franciaflex.magalie.persistence.dao;
+
+import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class PreparedArticleReceptionJpaDao extends AbstractPreparedArticleReceptionJpaDao<PreparedArticleReception> implements PreparedArticleReceptionDao{
+
+ public PreparedArticleReceptionJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public PreparedArticleReception findByBarcode(String barcode) {
+ TypedQuery<PreparedArticleReception> query = createQuery("from PreparedArticleReception par where par.barcode = :barcode");
+ query.setParameter("barcode", barcode);
+ return findUniqueOrNull(query);
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -27,13 +27,14 @@
import com.franciaflex.magalie.persistence.entity.MagalieUser;
import com.franciaflex.magalie.persistence.entity.RequestedArticle;
import com.franciaflex.magalie.persistence.entity.RequestedList;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
/**
* @author bleny
*/
-public interface RequestedArticleDao extends Dao<RequestedArticle> {
+public interface RequestedArticleDao extends JpaDao<RequestedArticle> {
List<RequestedArticle> findAllUndelivered(Building building, MagalieUser affectedTo, String listType);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/RequestedArticleJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,65 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.DeliveredRequestedListStatus;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.RequestedArticle;
+import com.franciaflex.magalie.persistence.entity.RequestedList;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class RequestedArticleJpaDao extends AbstractRequestedArticleJpaDao<RequestedArticle> implements RequestedArticleDao{
+
+ public RequestedArticleJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<RequestedArticle> findAllUndelivered(Building building, MagalieUser affectedTo, String listType) {
+ TypedQuery<RequestedArticle> query = createQuery(
+ "from RequestedArticle ra where "
+ + " ra not in (select dra.requestedArticle from DeliveredRequestedArticle dra) "
+ + " and ra.requestedList.building = :building "
+ + " and ra.requestedList.listType = :listType "
+ + " and ra.requestedList not in (select drl.requestedList from DeliveredRequestedList drl where drl.status = :complete or drl.status = :affected and drl.affectedTo != :affectedTo)");
+ query.setParameter("building", building);
+ query.setParameter("listType", listType);
+ query.setParameter("complete", DeliveredRequestedListStatus.COMPLETE);
+ query.setParameter("affected", DeliveredRequestedListStatus.AFFECTED);
+ query.setParameter("affectedTo", affectedTo);
+ return findAll(query);
+ }
+
+ @Override
+ public List<RequestedArticle> findAll(RequestedList requestedList) {
+ TypedQuery<RequestedArticle> query = createQuery("from RequestedArticle ra where ra.requestedList = :requestedList");
+ query.setParameter("requestedList", requestedList);
+ return findAll(query);
+ }
+
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -24,13 +24,14 @@
*/
import com.franciaflex.magalie.persistence.entity.RequestedList;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
/**
* @author bleny
*/
-public interface RequestedListDao extends Dao<RequestedList> {
+public interface RequestedListDao extends JpaDao<RequestedList> {
List<String> findAllDistinctListTypes();
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/RequestedListJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,43 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.RequestedList;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class RequestedListJpaDao extends AbstractRequestedListJpaDao<RequestedList> implements RequestedListDao{
+
+ public RequestedListJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<String> findAllDistinctListTypes() {
+ TypedQuery<String> query = entityManager.createQuery("select distinct rl.listType from RequestedList rl", String.class);
+ return query.getResultList();
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,13 +26,14 @@
import com.franciaflex.magalie.persistence.entity.Article;
import com.franciaflex.magalie.persistence.entity.Building;
import com.franciaflex.magalie.persistence.entity.StorageMovement;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
/**
* @author bleny
*/
-public interface StorageMovementDao extends Dao<StorageMovement> {
+public interface StorageMovementDao extends JpaDao<StorageMovement> {
List<StorageMovement> findAllByArticle(Article article);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StorageMovementJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,65 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.StorageMovement;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.List;
+
+public class StorageMovementJpaDao extends AbstractStorageMovementJpaDao<StorageMovement> implements StorageMovementDao{
+
+ public StorageMovementJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<StorageMovement> findAllByArticle(Article article) {
+ Query query = entityManager.createQuery("from StorageMovement sm where sm.article = :article");
+ query.setParameter("article", article);
+ return query.getResultList();
+ }
+
+ @Override
+ public List<StorageMovement> findAllInReception(Building building) {
+ Query query = entityManager.createQuery(
+ " from StorageMovement sm" +
+ " where sm.originLocation.code = :codeForReceptionLocations and sm.originLocation.warehouse.building = :building" +
+ " or " +
+ " sm.destinationLocation.code = :codeForReceptionLocations and sm.destinationLocation.warehouse.building = :building");
+ query.setParameter("building", building);
+ query.setParameter("codeForReceptionLocations", Locations.codeForReceptionLocations());
+ return query.getResultList();
+ }
+
+ @Override
+ public List<StorageMovement> findAll() {
+ Query query = entityManager.createQuery("from StorageMovement sm order by sm.orderDate");
+ return query.getResultList();
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,10 +26,11 @@
import com.franciaflex.magalie.persistence.entity.Building;
import com.franciaflex.magalie.persistence.entity.MagalieUser;
import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
-public interface StorageMovementOrderDao extends Dao<StorageMovementOrder> {
+public interface StorageMovementOrderDao extends JpaDao<StorageMovementOrder> {
public List<StorageMovementOrder> findNotConfirmedByUser(MagalieUser magalieUser, Building building);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StorageMovementOrderJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,53 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.List;
+
+public class StorageMovementOrderJpaDao extends AbstractStorageMovementOrderJpaDao<StorageMovementOrder> implements StorageMovementOrderDao{
+
+ public StorageMovementOrderJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<StorageMovementOrder> findNotConfirmedByUser(MagalieUser magalieUser, Building building) {
+ Query query = entityManager.createQuery(
+ " select distinct smo" +
+ " from StorageMovementOrder smo" +
+ " inner join smo.storageMovements as sm" +
+ " where sm.magalieUser = :magalieUser" +
+ " and sm.originLocation.warehouse.building = :building" +
+ " and sm.confirmDate is null");
+ query.setParameter("magalieUser", magalieUser);
+ query.setParameter("building", building);
+ return query.getResultList();
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,10 +26,11 @@
import com.franciaflex.magalie.persistence.entity.Article;
import com.franciaflex.magalie.persistence.entity.Building;
import com.franciaflex.magalie.persistence.entity.StoredArticle;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
-public interface StoredArticleDao extends Dao<StoredArticle> {
+public interface StoredArticleDao extends JpaDao<StoredArticle> {
List<StoredArticle> findAllForArticleInBuilding(Article article, Building building);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StoredArticleJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,77 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.StoredArticle;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class StoredArticleJpaDao extends AbstractStoredArticleJpaDao<StoredArticle> implements StoredArticleDao {
+
+ public StoredArticleJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<StoredArticle> findAllForArticleInBuilding(Article article, Building building) {
+ TypedQuery<StoredArticle> query = createQuery("from StoredArticle sa where sa.article = :article and sa.location.warehouse.withdrawAllowed = true and sa.location.warehouse.building = :building");
+ query.setParameter("article", article);
+ query.setParameter("building", building);
+ List<StoredArticle> resultList = findAll(query);
+ for (StoredArticle storedArticle : resultList) {
+ entityManager.detach(storedArticle);
+ }
+ return resultList;
+ }
+
+ @Override
+ public List<StoredArticle> findAllReceivedForAllSupplier(Building building) {
+ TypedQuery<StoredArticle> query = createQuery("from StoredArticle sa where sa.location.warehouse.building = :building and sa.location.code = :code");
+ query.setParameter("building", building);
+ query.setParameter("code", Locations.codeForReceptionLocations());
+ List<StoredArticle> resultList = findAll(query);
+ for (StoredArticle storedArticle : resultList) {
+ entityManager.detach(storedArticle);
+ }
+ return resultList;
+ }
+
+ @Override
+ public List<StoredArticle> findAllReceivedForSupplier(Building building, String supplierId) {
+ TypedQuery<StoredArticle> query = createQuery("from StoredArticle sa where sa.location.warehouse.building = :building and sa.location.code = :code and sa.article.supplier.id = :supplierId");
+ query.setParameter("building", building);
+ query.setParameter("supplierId", supplierId);
+ query.setParameter("code", Locations.codeForReceptionLocations());
+ List<StoredArticle> resultList = findAll(query);
+ for (StoredArticle storedArticle : resultList) {
+ entityManager.detach(storedArticle);
+ }
+ return resultList;
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -25,13 +25,14 @@
import com.franciaflex.magalie.persistence.entity.Building;
import com.franciaflex.magalie.persistence.entity.Supplier;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
/**
* @author bleny
*/
-public interface SupplierDao extends Dao<Supplier> {
+public interface SupplierDao extends JpaDao<Supplier> {
List<Supplier> findAllWithReceivedArticles(Building building);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/SupplierJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,50 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.Location;
+import com.franciaflex.magalie.persistence.entity.Supplier;
+import com.franciaflex.magalie.persistence.entity.Warehouse;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class SupplierJpaDao extends AbstractSupplierJpaDao<Supplier> implements SupplierDao{
+
+ public SupplierJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<Supplier> findAllWithReceivedArticles(Building building) {
+ TypedQuery<Supplier> query = createQuery("select sa.article.supplier from StoredArticle sa where sa.location.code = :code and sa.location.warehouse.building = :building");
+ query.setParameter(Warehouse.PROPERTY_BUILDING, building);
+ query.setParameter(Location.PROPERTY_CODE, Locations.codeForReceptionLocations());
+ return findAll(query);
+ }
+
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,11 +26,12 @@
import com.franciaflex.magalie.persistence.entity.Article;
import com.franciaflex.magalie.persistence.entity.Building;
import com.franciaflex.magalie.persistence.entity.UnavailableArticle;
+import org.nuiton.jpa.api.JpaDao;
/**
* @author bleny
*/
-public interface UnavailableArticleDao extends Dao<UnavailableArticle> {
+public interface UnavailableArticleDao extends JpaDao<UnavailableArticle> {
UnavailableArticle findByArticle(Building building, Article article);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/UnavailableArticleJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,46 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.UnavailableArticle;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class UnavailableArticleJpaDao extends AbstractUnavailableArticleJpaDao<UnavailableArticle> implements UnavailableArticleDao{
+
+ public UnavailableArticleJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public UnavailableArticle findByArticle(Building building, Article article) {
+ TypedQuery<UnavailableArticle> query = createQuery("from UnavailableArticle ua where ua.article = :article and ua.building = :building");
+ query.setParameter(UnavailableArticle.PROPERTY_ARTICLE, article);
+ query.setParameter(UnavailableArticle.PROPERTY_BUILDING, building);
+ return findUniqueOrNull(query);
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -25,13 +25,14 @@
import com.franciaflex.magalie.persistence.entity.Building;
import com.franciaflex.magalie.persistence.entity.Warehouse;
+import org.nuiton.jpa.api.JpaDao;
import java.util.List;
/**
* @author bleny
*/
-public interface WarehouseDao extends Dao<Warehouse> {
+public interface WarehouseDao extends JpaDao<Warehouse> {
List<Warehouse> findAllWithoutLocations(Building building);
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseJpaDao.java (from rev 191, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/WarehouseJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseJpaDao.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -0,0 +1,47 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.Warehouse;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class WarehouseJpaDao extends AbstractWarehouseJpaDao<Warehouse> implements WarehouseDao {
+
+ public WarehouseJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<Warehouse> findAllWithoutLocations(Building building) {
+ TypedQuery<Warehouse> query = entityManager.createQuery("from Warehouse w where w.building = :building and w in (select l.warehouse from Location l where l.code = :code)", getEntityClass());
+ query.setParameter(Warehouse.PROPERTY_BUILDING, building);
+ query.setParameter(Warehouse.PROPERTY_CODE, Locations.codeForWarehouseWithoutLocations());
+ return query.getResultList();
+ }
+}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/AbstractEntity.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/AbstractEntity.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/AbstractEntity.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,53 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.google.common.base.Objects;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-public abstract class AbstractEntity {
-
- public abstract String getId();
-
- @Override
- public boolean equals(Object o) {
- String id = getId();
- if (this == o) return true;
- if (!(o instanceof AbstractEntity)) return false;
- AbstractEntity that = (AbstractEntity) o;
- if (id == null && that.getId() == null) return false;
- if (!id.equals(that.getId())) return false;
- return Objects.equal(id, that.getId());
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(getId());
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Article.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Article.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Article.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -24,72 +24,13 @@
*/
import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
import java.util.Set;
@Entity
-public class Article extends AbstractEntity {
+public class Article extends AbstractJpaArticle {
- @Id
- protected String id;
+ private static final long serialVersionUID = 1L;
- @ManyToMany
- protected Set<Location> fixedLocations;
-
- @ManyToOne
- protected Supplier supplier;
-
- protected String description;
-
- protected String code;
-
- protected String unit;
-
- protected boolean fixedLocationsFirst;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Set<Location> getFixedLocations() {
- return fixedLocations;
- }
-
- public void setFixedLocations(Set<Location> fixedLocations) {
- this.fixedLocations = fixedLocations;
- }
-
- public String getCode() {
- return code;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-
- public String getUnit() {
- return unit;
- }
-
- public void setUnit(String unit) {
- this.unit = unit;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
public boolean isFixedLocation(Location location) {
boolean isFixedLocation = false;
Set<Location> fixedLocations = getFixedLocations();
@@ -98,20 +39,4 @@
}
return isFixedLocation;
}
-
- public boolean isFixedLocationsFirst() {
- return fixedLocationsFirst;
- }
-
- public void setFixedLocationsFirst(boolean fixedLocationsFirst) {
- this.fixedLocationsFirst = fixedLocationsFirst;
- }
-
- public Supplier getSupplier() {
- return supplier;
- }
-
- public void setSupplier(Supplier supplier) {
- this.supplier = supplier;
- }
-}
+} //Article
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Building.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Building.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Building.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,53 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class Building extends AbstractEntity {
-
- @Id
- protected String id;
-
- protected String code;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getCode() {
- return code;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedArticle.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedArticle.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedArticle.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -24,45 +24,14 @@
*/
import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.OneToOne;
@Entity
-public class DeliveredRequestedArticle extends AbstractEntity {
+public class DeliveredRequestedArticle extends AbstractJpaDeliveredRequestedArticle {
- @Id
- @GeneratedValue
- protected String id;
+ private static final long serialVersionUID = 1L;
- @OneToOne
- protected StorageMovementOrder storageMovementOrder;
-
- @OneToOne
- protected RequestedArticle requestedArticle;
-
- @Override
- public String getId() {
- return id;
- }
-
- public StorageMovementOrder getStorageMovementOrder() {
- return storageMovementOrder;
- }
-
- public void setStorageMovementOrder(StorageMovementOrder storageMovementOrder) {
- this.storageMovementOrder = storageMovementOrder;
- }
-
- public RequestedArticle getRequestedArticle() {
- return requestedArticle;
- }
-
- public void setRequestedArticle(RequestedArticle requestedArticle) {
- this.requestedArticle = requestedArticle;
- }
-
public boolean isConfirmed() {
return getStorageMovementOrder().isConfirmed();
}
-}
+
+} //DeliveredRequestedArticle
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedList.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedList.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedList.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,82 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.OneToOne;
-
-@Entity
-public class DeliveredRequestedList extends AbstractEntity {
-
- @Id
- @GeneratedValue
- protected String id;
-
- @OneToOne
- protected RequestedList requestedList;
-
- @OneToOne
- protected MagalieUser affectedTo;
-
- @Enumerated(value = EnumType.STRING)
- protected DeliveredRequestedListStatus status;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public RequestedList getRequestedList() {
- return requestedList;
- }
-
- public void setRequestedList(RequestedList requestedList) {
- this.requestedList = requestedList;
- }
-
- public MagalieUser getAffectedTo() {
- return affectedTo;
- }
-
- public void setAffectedTo(MagalieUser affectedTo) {
- this.affectedTo = affectedTo;
- }
-
- public DeliveredRequestedListStatus getStatus() {
- return status;
- }
-
- public void setStatus(DeliveredRequestedListStatus status) {
- this.status = status;
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedListStatus.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedListStatus.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/DeliveredRequestedListStatus.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,32 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-public enum DeliveredRequestedListStatus {
-
- PENDING,
- AFFECTED,
- COMPLETE
-
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Kanban.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Kanban.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Kanban.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,78 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-
-@Entity
-public class Kanban extends AbstractEntity {
-
- @Id
- @GeneratedValue
- protected String id;
-
- @ManyToOne
- protected Article article;
-
- @ManyToOne
- protected Warehouse warehouse;
-
- protected double requiredQuantity;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Article getArticle() {
- return article;
- }
-
- public void setArticle(Article article) {
- this.article = article;
- }
-
- public Warehouse getWarehouse() {
- return warehouse;
- }
-
- public void setWarehouse(Warehouse warehouse) {
- this.warehouse = warehouse;
- }
-
- public double getRequiredQuantity() {
- return requiredQuantity;
- }
-
- public void setRequiredQuantity(double requiredQuantity) {
- this.requiredQuantity = requiredQuantity;
- }
-}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Location.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Location.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Location.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -24,78 +24,14 @@
*/
import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
@Entity
-public class Location extends AbstractEntity {
+public class Location extends AbstractJpaLocation {
- @Id
- protected String id;
+ private static final long serialVersionUID = 1L;
- @ManyToOne
- protected Warehouse warehouse;
-
- protected String code;
-
- protected int requiredAccreditationLevel;
-
- protected boolean fullLocation;
-
- protected boolean requiredCraneMan;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Warehouse getWarehouse() {
- return warehouse;
- }
-
- public void setWarehouse(Warehouse warehouse) {
- this.warehouse = warehouse;
- }
-
- public String getCode() {
- return code;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-
- public int getRequiredAccreditationLevel() {
- return requiredAccreditationLevel;
- }
-
- public void setRequiredAccreditationLevel(int requiredAccreditationLevel) {
- this.requiredAccreditationLevel = requiredAccreditationLevel;
- }
-
public String getBarcode() {
String barcode = getWarehouse().getCode() + getCode();
return barcode;
}
-
- public boolean isFullLocation() {
- return fullLocation;
- }
-
- public void setFullLocation(boolean fullLocation) {
- this.fullLocation = fullLocation;
- }
-
- public boolean isRequiredCraneMan() {
- return requiredCraneMan;
-}
-
- public void setRequiredCraneMan(boolean requiredCraneMan) {
- this.requiredCraneMan = requiredCraneMan;
- }
-
-}
+} //Location
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/LocationError.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/LocationError.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/LocationError.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,91 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToOne;
-import java.util.Date;
-
-@Entity
-public class LocationError extends AbstractEntity {
-
- @Id
- @GeneratedValue
- protected String id;
-
- @OneToOne
- protected Location location;
-
- @OneToOne
- protected Article article;
-
- @ManyToOne
- protected MagalieUser magalieUser;
-
- protected Date reportDate;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Location getLocation() {
- return location;
- }
-
- public void setLocation(Location location) {
- this.location = location;
- }
-
- public MagalieUser getMagalieUser() {
- return magalieUser;
- }
-
- public void setMagalieUser(MagalieUser magalieUser) {
- this.magalieUser = magalieUser;
- }
-
- public Date getReportDate() {
- return reportDate;
- }
-
- public void setReportDate(Date reportDate) {
- this.reportDate = reportDate;
- }
-
- public Article getArticle() {
- return article;
- }
-
- public void setArticle(Article article) {
- this.article = article;
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/MagalieUser.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/MagalieUser.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/MagalieUser.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,85 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class MagalieUser extends AbstractEntity {
-
- @Id
- protected String id;
-
- protected String login;
-
- protected String name;
-
- protected int accreditationLevel;
-
- protected boolean craneMan;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getLogin() {
- return login;
- }
-
- public void setLogin(String login) {
- this.login = login;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public int getAccreditationLevel() {
- return accreditationLevel;
- }
-
- public void setAccreditationLevel(int accreditationLevel) {
- this.accreditationLevel = accreditationLevel;
- }
-
-
- public boolean isCraneMan() {
- return craneMan;
- }
-
- public void setCraneMan(boolean craneMan) {
- this.craneMan = craneMan;
- }
-
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/PreparedArticleReception.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/PreparedArticleReception.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/PreparedArticleReception.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,52 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-
-@Entity
-public class PreparedArticleReception extends AbstractEntity {
-
- @Id
- protected String id;
-
- protected String barcode;
-
- @ManyToOne
- protected StoredArticle storedArticle;
-
- protected double quantity;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getBarcode() {
- return barcode;
- }
-
- public void setBarcode(String barcode) {
- this.barcode = barcode;
- }
-
- public StoredArticle getStoredArticle() {
- return storedArticle;
- }
-
- public void setStoredArticle(StoredArticle storedArticle) {
- this.storedArticle = storedArticle;
- }
-
- public double getQuantity() {
- return quantity;
- }
-
- public void setQuantity(double quantity) {
- this.quantity = quantity;
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/RequestedArticle.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/RequestedArticle.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/RequestedArticle.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,88 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToOne;
-
-@Entity
-public class RequestedArticle extends AbstractEntity {
-
- @Id
- protected String id;
-
- @ManyToOne
- protected Article article;
-
- @ManyToOne
- protected RequestedList requestedList;
-
- @OneToOne
- protected Location destinationLocation;
-
- protected double quantity;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Article getArticle() {
- return article;
- }
-
- public void setArticle(Article article) {
- this.article = article;
- }
-
- public double getQuantity() {
- return quantity;
- }
-
- public void setQuantity(double quantity) {
- this.quantity = quantity;
- }
-
- public RequestedList getRequestedList() {
- return requestedList;
- }
-
- public void setRequestedList(RequestedList requestedList) {
- this.requestedList = requestedList;
- }
-
- public Location getDestinationLocation() {
- return destinationLocation;
- }
-
- public void setDestinationLocation(Location destinationLocation) {
- this.destinationLocation = destinationLocation;
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/RequestedList.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/RequestedList.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/RequestedList.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,96 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import java.util.Date;
-
-@Entity
-public class RequestedList extends AbstractEntity {
-
- @Id
- protected String id;
-
- @ManyToOne
- protected Building building;
-
- protected String code;
-
- protected Date requestDate;
-
- protected boolean urgent;
-
- protected String listType;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Date getRequestDate() {
- return requestDate;
- }
-
- public void setRequestDate(Date requestDate) {
- this.requestDate = requestDate;
- }
-
- public boolean isUrgent() {
- return urgent;
- }
-
- public void setUrgent(boolean urgent) {
- this.urgent = urgent;
- }
-
- public String getCode() {
- return code;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-
- public Building getBuilding() {
- return building;
- }
-
- public void setBuilding(Building building) {
- this.building = building;
- }
-
- public String getListType() {
- return listType;
- }
-
- public void setListType(String listType) {
- this.listType = listType;
- }
-}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StorageMovement.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StorageMovement.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StorageMovement.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,117 +26,18 @@
import com.google.common.base.Objects;
import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import java.util.Date;
@Entity
-public class StorageMovement extends AbstractEntity {
+public class StorageMovement extends AbstractJpaStorageMovement {
- @Id
- @GeneratedValue
- protected String id;
+ private static final long serialVersionUID = 1L;
- @ManyToOne
- protected Location originLocation;
-
- @ManyToOne
- protected Location destinationLocation;
-
- @ManyToOne
- protected Article article;
-
- @ManyToOne
- protected MagalieUser magalieUser;
-
- protected double expectedQuantity;
-
- protected Date orderDate;
-
- protected Double actualQuantity;
-
- protected Date confirmDate;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Location getOriginLocation() {
- return originLocation;
- }
-
- public void setOriginLocation(Location originLocation) {
- this.originLocation = originLocation;
- }
-
- public Location getDestinationLocation() {
- return destinationLocation;
- }
-
- public void setDestinationLocation(Location destinationLocation) {
- this.destinationLocation = destinationLocation;
- }
-
- public Article getArticle() {
- return article;
- }
-
- public void setArticle(Article article) {
- this.article = article;
- }
-
- public MagalieUser getMagalieUser() {
- return magalieUser;
- }
-
- public void setMagalieUser(MagalieUser magalieUser) {
- this.magalieUser = magalieUser;
- }
-
- public double getExpectedQuantity() {
- return expectedQuantity;
- }
-
- public void setExpectedQuantity(double expectedQuantity) {
- this.expectedQuantity = expectedQuantity;
- }
-
- public Date getOrderDate() {
- return orderDate;
- }
-
- public void setOrderDate(Date orderDate) {
- this.orderDate = orderDate;
- }
-
- public Date getConfirmDate() {
- return confirmDate;
- }
-
- public void setConfirmDate(Date confirmDate) {
- this.confirmDate = confirmDate;
- }
-
public boolean isConfirmed() {
return confirmDate != null;
}
- public Double getActualQuantity() {
- return actualQuantity;
- }
-
- public void setActualQuantity(Double actualQuantity) {
- this.actualQuantity = actualQuantity;
- }
-
public double getQuantity() {
double quantity = Objects.firstNonNull(actualQuantity, expectedQuantity);
return quantity;
}
-}
+} //StorageMovement
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StorageMovementOrder.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StorageMovementOrder.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StorageMovementOrder.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -23,51 +23,22 @@
* #L%
*/
-import com.franciaflex.magalie.persistence.Entities;
import com.franciaflex.magalie.persistence.StorageMovements;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.nuiton.jpa.api.JpaEntities;
-import javax.persistence.CascadeType;
import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderColumn;
-import java.util.List;
import java.util.Set;
@Entity
-public class StorageMovementOrder extends AbstractEntity {
+public class StorageMovementOrder extends AbstractJpaStorageMovementOrder {
- @Id
- @GeneratedValue
- protected String id;
+ private static final long serialVersionUID = 1L;
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- @OneToMany(cascade = CascadeType.ALL)
- @OrderColumn
- protected List<StorageMovement> storageMovements;
-
- public List<StorageMovement> getStorageMovements() {
- return storageMovements;
- }
-
- public void setStorageMovements(List<StorageMovement> storageMovements) {
- this.storageMovements = storageMovements;
- }
-
protected Set<Article> getArticles() {
Set<Article> articles =
Sets.newHashSet(
@@ -86,17 +57,17 @@
public double getQuantity() {
double quantity = 0.;
- for (StorageMovement storageMovement : storageMovements) {
+ for (StorageMovement storageMovement : this.storageMovements) {
quantity += storageMovement.getExpectedQuantity();
}
return quantity;
}
public void addStorageMovement(StorageMovement storageMovement) {
- if (storageMovements == null) {
- storageMovements = Lists.newLinkedList();
+ if (this.storageMovements == null) {
+ this.storageMovements= Lists.newLinkedList();
}
- storageMovements.add(storageMovement);
+ super.addStorageMovements(storageMovement);
}
public Set<Location> getLocations() {
@@ -115,7 +86,7 @@
Iterables.find(
getStorageMovements(),
Predicates.compose(
- Entities.entityHasId(locationId),
+ JpaEntities.entityHasId(locationId),
StorageMovements.getOriginFunction()
),
null
@@ -150,5 +121,4 @@
StorageMovements.storageMovementIsConfirmed());
return isConfirmed;
}
-
-}
+} //StorageMovementOrder
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StoredArticle.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StoredArticle.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/StoredArticle.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,76 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-
-@Entity
-public class StoredArticle extends AbstractEntity {
-
- @Id
- protected String id;
-
- @ManyToOne
- protected Article article;
-
- @ManyToOne
- protected Location location;
-
- protected double quantity;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Location getLocation() {
- return location;
- }
-
- public void setLocation(Location location) {
- this.location = location;
- }
-
- public Article getArticle() {
- return article;
- }
-
- public void setArticle(Article article) {
- this.article = article;
- }
-
- public double getQuantity() {
- return quantity;
- }
-
- public void setQuantity(double quantity) {
- this.quantity = quantity;
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Supplier.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Supplier.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Supplier.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,53 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class Supplier extends AbstractEntity {
-
- @Id
- protected String id;
-
- protected String name;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/UnavailableArticle.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/UnavailableArticle.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/UnavailableArticle.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,79 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.OneToOne;
-import java.util.Date;
-
-@Entity
-public class UnavailableArticle extends AbstractEntity {
-
- @Id
- @GeneratedValue
- protected String id;
-
- @OneToOne
- protected Article article;
-
- @OneToOne
- protected Building building;
-
- protected Date reportDate;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Article getArticle() {
- return article;
- }
-
- public void setArticle(Article article) {
- this.article = article;
- }
-
- public Building getBuilding() {
- return building;
- }
-
- public void setBuilding(Building building) {
- this.building = building;
- }
-
- public void setReportDate(Date reportDate) {
- this.reportDate = reportDate;
- }
-
- public Date getReportDate() {
- return reportDate;
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Warehouse.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Warehouse.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Warehouse.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,75 +0,0 @@
-package com.franciaflex.magalie.persistence.entity;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-
-@Entity
-public class Warehouse extends AbstractEntity {
-
- @Id
- protected String id;
-
- protected String code;
-
- @ManyToOne
- protected Building building;
-
- protected boolean withdrawAllowed;
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Building getBuilding() {
- return building;
- }
-
- public void setBuilding(Building building) {
- this.building = building;
- }
-
- public String getCode() {
- return code;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-
- public boolean isWithdrawAllowed() {
- return withdrawAllowed;
- }
-
- public void setWithdrawAllowed(boolean withdrawAllowed) {
- this.withdrawAllowed = withdrawAllowed;
- }
-}
Modified: branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties 2013-05-25 14:34:59 UTC (rev 193)
@@ -1 +1,8 @@
-com.franciaflex.magalie.persistence.entities.Article.attribute.fixedLocations.stereotype=unique
+com.franciaflex.magalie.persistence.entity.Article.attribute.fixedLocations.stereotype=unique
+com.franciaflex.magalie.persistence.entity.DeliveredRequestedArticle.class.stereotype=generatedValue
+com.franciaflex.magalie.persistence.entity.DeliveredRequestedList.class.stereotype=generatedValue
+com.franciaflex.magalie.persistence.entity.Kanban.class.stereotype=generatedValue
+com.franciaflex.magalie.persistence.entity.LocationError.class.stereotype=generatedValue
+com.franciaflex.magalie.persistence.entity.StorageMovement.class.stereotype=generatedValue
+com.franciaflex.magalie.persistence.entity.StorageMovementOrder.class.stereotype=generatedValue
+com.franciaflex.magalie.persistence.entity.UnavailableArticle.class.stereotype=generatedValue
Modified: branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.zargo
===================================================================
(Binary files differ)
Modified: branches/magalie-eugene/magalie-services/pom.xml
===================================================================
--- branches/magalie-eugene/magalie-services/pom.xml 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-services/pom.xml 2013-05-25 14:34:59 UTC (rev 193)
@@ -9,7 +9,6 @@
<version>0.1-SNAPSHOT</version>
</parent>
- <groupId>com.franciaflex</groupId>
<artifactId>magalie-services</artifactId>
<name>MagaLiE :: Services</name>
<description>Services pour MagaLiE</description>
@@ -21,6 +20,11 @@
<dependencies>
<dependency>
+ <groupId>org.nuiton.jpa</groupId>
+ <artifactId>nuiton-jpa-junit</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
</dependency>
Modified: branches/magalie-eugene/magalie-services/src/test/java/com/franciaflex/magalie/services/AbstractMagalieServiceTest.java
===================================================================
--- branches/magalie-eugene/magalie-services/src/test/java/com/franciaflex/magalie/services/AbstractMagalieServiceTest.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-services/src/test/java/com/franciaflex/magalie/services/AbstractMagalieServiceTest.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -26,6 +26,7 @@
import com.franciaflex.magalie.MagalieApplicationConfig;
import com.franciaflex.magalie.services.service.FixturesService;
import org.junit.Rule;
+import org.nuiton.jpa.junit.JpaEntityManagerRule;
import javax.persistence.EntityManager;
import java.util.Map;
Deleted: branches/magalie-eugene/magalie-services/src/test/java/com/franciaflex/magalie/services/JpaEntityManagerRule.java
===================================================================
--- branches/magalie-eugene/magalie-services/src/test/java/com/franciaflex/magalie/services/JpaEntityManagerRule.java 2013-05-24 22:23:42 UTC (rev 192)
+++ branches/magalie-eugene/magalie-services/src/test/java/com/franciaflex/magalie/services/JpaEntityManagerRule.java 2013-05-25 14:34:59 UTC (rev 193)
@@ -1,122 +0,0 @@
-package com.franciaflex.magalie.services;
-
-/*
- * #%L
- * MagaLiE :: Services
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.JpaUtil;
-import com.google.common.base.Joiner;
-import com.google.common.base.Preconditions;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import java.util.Date;
-import java.util.Map;
-
-public class JpaEntityManagerRule implements TestRule {
-
- private static final Log log = LogFactory.getLog(JpaEntityManagerRule.class);
-
- protected String persistenceUnitName;
-
- protected String timestamp = String.valueOf(new Date().getTime());
-
- protected EntityManager entityManager;
-
- protected boolean open = false;
-
- protected Map<String, String> jpaParameters;
-
- public JpaEntityManagerRule(String persistenceUnitName, Map<String, String> jpaParameters) {
- this.persistenceUnitName = persistenceUnitName;
- this.jpaParameters = jpaParameters;
- }
-
- @Override
- public Statement apply(final Statement base, Description description) {
-
- final String testClassName = description.getClassName();
-
- final String testMethodName = description.getMethodName();
-
- if (log.isDebugEnabled()) {
- log.debug("will create entityManager for test class " + testClassName + " and method " + testMethodName);
- }
-
- return new Statement() {
- @Override
- public void evaluate() throws Throwable {
- createEntityManager(testClassName, testMethodName);
- try {
- base.evaluate();
- } finally {
- closeEntityManager();
- }
- }
- };
- }
-
- protected void createEntityManager(String testClassName, String testMethodName) {
-
- String context = Joiner.on('_').join(testClassName, testMethodName, timestamp);
-
- EntityManagerFactory entityManagerFactory = JpaUtil.createTempEntityManagerFactory(persistenceUnitName, context, jpaParameters);
-
- entityManager = entityManagerFactory.createEntityManager();
-
- if (log.isDebugEnabled()) {
- log.debug("created entityManager " + entityManager);
- }
-
- open = true;
-
- }
-
- public EntityManager getEntityManager() {
-
- Preconditions.checkState(open);
-
- return entityManager;
-
- }
-
- /**
- * Override to tear down your specific external resource.
- */
- protected void closeEntityManager() {
-
- if (log.isDebugEnabled()) {
- log.debug("close entityManager " + entityManager);
- }
-
- open = false;
-
- entityManager.close();
-
- }
-
-}
1
0
r192 - in branches/magalie-eugene: . magalie-persistence magalie-persistence/src/main/xmi
by tchemit@users.forge.codelutin.com 24 May '13
by tchemit@users.forge.codelutin.com 24 May '13
24 May '13
Author: tchemit
Date: 2013-05-25 00:23:42 +0200 (Sat, 25 May 2013)
New Revision: 192
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
use nuiton-jpa + last eugene snapshot version
Added:
branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties
Modified:
branches/magalie-eugene/magalie-persistence/pom.xml
branches/magalie-eugene/pom.xml
Modified: branches/magalie-eugene/magalie-persistence/pom.xml
===================================================================
--- branches/magalie-eugene/magalie-persistence/pom.xml 2013-05-24 14:19:27 UTC (rev 191)
+++ branches/magalie-eugene/magalie-persistence/pom.xml 2013-05-24 22:23:42 UTC (rev 192)
@@ -9,7 +9,6 @@
<version>0.1-SNAPSHOT</version>
</parent>
- <groupId>com.franciaflex</groupId>
<artifactId>magalie-persistence</artifactId>
<name>MagaLiE :: Persistence</name>
<description>Couche d'accès à la base de données pour MagaLiE</description>
@@ -21,6 +20,16 @@
<dependencies>
<dependency>
+ <groupId>org.nuiton.jpa</groupId>
+ <artifactId>nuiton-jpa-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.jpa</groupId>
+ <artifactId>nuiton-jpa-junit</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
</dependency>
@@ -88,35 +97,42 @@
<build>
<plugins>
- <!--<plugin>-->
- <!--<groupId>org.nuiton.eugene</groupId>-->
- <!--<artifactId>eugene-maven-plugin</artifactId>-->
- <!--<configuration>-->
- <!--<inputs>zargo</inputs>-->
- <!--<resolver>org.nuiton.util.FasterCachedResourceResolver</resolver>-->
- <!--</configuration>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<id>generate-entities</id>-->
- <!--<phase>generate-sources</phase>-->
- <!--<configuration>-->
- <!--<!– Corresponding to extracted package from zargo file –>-->
- <!--<fullPackagePath>com.franciaflex.magalie.persistence.entities</fullPackagePath>-->
- <!--<!– DefaultPackage used for DAOHelper generation –>-->
- <!--<defaultPackage>com.franciaflex.magalie.persistence.entities</defaultPackage>-->
- <!--<templates>-->
- <!--org.nuiton.eugene.java.JavaInterfaceTransformer,-->
- <!--org.nuiton.eugene.java.JavaBeanTransformer,-->
- <!--org.nuiton.eugene.java.JavaEnumerationTransformer,-->
- <!--org.nuiton.topia.generator.TopiaMetaTransformer-->
- <!--</templates>-->
- <!--</configuration>-->
- <!--<goals>-->
- <!--<goal>generate</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--</plugin>-->
+ <plugin>
+ <groupId>org.nuiton.eugene</groupId>
+ <artifactId>eugene-maven-plugin</artifactId>
+ <configuration>
+ <inputs>zargo</inputs>
+ <resolver>org.nuiton.util.FasterCachedResourceResolver</resolver>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-entities</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <!-- Corresponding to extracted package from zargo file -->
+ <fullPackagePath>com.franciaflex.magalie.persistence.entities</fullPackagePath>
+ <!-- DefaultPackage used for DAOHelper generation -->
+ <defaultPackage>com.franciaflex.magalie.persistence.entities</defaultPackage>
+ <templates>
+ org.nuiton.jpa.templates.JpaEntityTransformer,
+ org.nuiton.jpa.templates.JpaDaoTransformer,
+ org.nuiton.jpa.templates.JpaPersistenceContextTransformer,
+ org.nuiton.eugene.java.JavaEnumerationTransformer
+ </templates>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.nuiton.jpa</groupId>
+ <artifactId>nuiton-jpa-templates</artifactId>
+ <version>${nuitonJpaVersion}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
Added: branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties 2013-05-24 22:23:42 UTC (rev 192)
@@ -0,0 +1 @@
+com.franciaflex.magalie.persistence.entities.Article.attribute.fixedLocations.stereotype=unique
Property changes on: branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: branches/magalie-eugene/pom.xml
===================================================================
--- branches/magalie-eugene/pom.xml 2013-05-24 14:19:27 UTC (rev 191)
+++ branches/magalie-eugene/pom.xml 2013-05-24 22:23:42 UTC (rev 192)
@@ -90,6 +90,8 @@
<projectId>franciaflex-magalie</projectId>
<!-- versions -->
+ <nuitonJpaVersion>0.1-SNAPSHOT</nuitonJpaVersion>
+
<nuitonWebVersion>1.13</nuitonWebVersion>
<nuitonUtilsVersion>2.6.12</nuitonUtilsVersion>
<h2Version>1.3.170</h2Version>
@@ -105,7 +107,7 @@
<mockitoVersion>1.9.5</mockitoVersion>
<nuitonI18nVersion>2.5</nuitonI18nVersion>
<topiaVersion>2.7.1</topiaVersion>
- <eugeneVersion>2.5.6.1</eugeneVersion>
+ <eugeneVersion>2.6.3-SNAPSHOT</eugeneVersion>
<!-- license to use -->
<license.licenseName>agpl_v3</license.licenseName>
@@ -146,6 +148,19 @@
<version>${h2Version}</version>
</dependency>
+ <dependency>
+ <groupId>org.nuiton.jpa</groupId>
+ <artifactId>nuiton-jpa-api</artifactId>
+ <version>${nuitonJpaVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.jpa</groupId>
+ <artifactId>nuiton-jpa-junit</artifactId>
+ <version>${nuitonJpaVersion}</version>
+ <scope>test</scope>
+ </dependency>
+
<!-- Nuiton libs -->
<dependency>
<groupId>org.nuiton</groupId>
1
0
Author: bleny
Date: 2013-05-24 16:19:27 +0200 (Fri, 24 May 2013)
New Revision: 191
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
creating branch for generating jpa entities
Added:
branches/magalie-eugene/
1
0
24 May '13
Author: Bavencoff
Date: 2013-05-24 10:55:25 +0200 (Fri, 24 May 2013)
New Revision: 190
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
UML
Modified:
trunk/magalie-persistence/src/main/xmi/magalie.zargo
Modified: trunk/magalie-persistence/src/main/xmi/magalie.zargo
===================================================================
(Binary files differ)
1
0
23 May '13
Author: bleny
Date: 2013-05-23 18:25:34 +0200 (Thu, 23 May 2013)
New Revision: 189
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
refs #2167 implementation with a fixme
Added:
trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java
trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/PreparedArticleReceptionJpaDao.java
trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/PreparedArticleReception.java
trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PreparePreparedArticleReceptionAction.java
trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-prepared-article-reception-input.jsp
Modified:
trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaMagaliePersistenceContext.java
trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/MagaliePersistenceContext.java
trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/MagalieFixtures.java
trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/FixturesService.java
trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ReceptionService.java
trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ReceptionTask.java
trunk/magalie-services/src/main/resources/fixtures.yaml
trunk/magalie-services/src/main/resources/fixtures2.yaml
trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/ReceiveArticleAction.java
trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp
trunk/magalie-web/src/main/webapp/WEB-INF/content/receive-article-input.jsp
trunk/magalie-web/src/main/webapp/js/receive-article-input.js
Modified: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaMagaliePersistenceContext.java
===================================================================
--- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaMagaliePersistenceContext.java 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/JpaMagaliePersistenceContext.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -29,6 +29,7 @@
import com.franciaflex.magalie.persistence.dao.DeliveredRequestedListDao;
import com.franciaflex.magalie.persistence.dao.KanbanDao;
import com.franciaflex.magalie.persistence.dao.MagalieUserDao;
+import com.franciaflex.magalie.persistence.dao.PreparedArticleReceptionDao;
import com.franciaflex.magalie.persistence.dao.RequestedArticleDao;
import com.franciaflex.magalie.persistence.dao.LocationDao;
import com.franciaflex.magalie.persistence.dao.LocationErrorDao;
@@ -47,6 +48,7 @@
import com.franciaflex.magalie.persistence.dao.jpa.LocationErrorJpaDao;
import com.franciaflex.magalie.persistence.dao.jpa.LocationJpaDao;
import com.franciaflex.magalie.persistence.dao.jpa.MagalieUserJpaDao;
+import com.franciaflex.magalie.persistence.dao.jpa.PreparedArticleReceptionJpaDao;
import com.franciaflex.magalie.persistence.dao.jpa.RequestedArticleJpaDao;
import com.franciaflex.magalie.persistence.dao.jpa.RequestedListJpaDao;
import com.franciaflex.magalie.persistence.dao.jpa.StorageMovementJpaDao;
@@ -173,4 +175,9 @@
public UnavailableArticleDao getUnavailableArticleDao() {
return new UnavailableArticleJpaDao(entityManager);
}
+
+ @Override
+ public PreparedArticleReceptionDao getPreparedArticleReceptionDao() {
+ return new PreparedArticleReceptionJpaDao(entityManager);
+ }
}
Modified: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/MagaliePersistenceContext.java
===================================================================
--- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/MagaliePersistenceContext.java 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/MagaliePersistenceContext.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -31,6 +31,7 @@
import com.franciaflex.magalie.persistence.dao.LocationDao;
import com.franciaflex.magalie.persistence.dao.LocationErrorDao;
import com.franciaflex.magalie.persistence.dao.MagalieUserDao;
+import com.franciaflex.magalie.persistence.dao.PreparedArticleReceptionDao;
import com.franciaflex.magalie.persistence.dao.RequestedArticleDao;
import com.franciaflex.magalie.persistence.dao.RequestedListDao;
import com.franciaflex.magalie.persistence.dao.StorageMovementDao;
@@ -83,4 +84,6 @@
UnavailableArticleDao getUnavailableArticleDao();
+ PreparedArticleReceptionDao getPreparedArticleReceptionDao();
+
}
Added: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java
===================================================================
--- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java (rev 0)
+++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -0,0 +1,12 @@
+package com.franciaflex.magalie.persistence.dao;
+
+import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
+
+/**
+ * @author bleny
+ */
+public interface PreparedArticleReceptionDao extends Dao<PreparedArticleReception> {
+
+ PreparedArticleReception findByBarcode(String barcode);
+
+}
Added: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/PreparedArticleReceptionJpaDao.java
===================================================================
--- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/PreparedArticleReceptionJpaDao.java (rev 0)
+++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/PreparedArticleReceptionJpaDao.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -0,0 +1,26 @@
+package com.franciaflex.magalie.persistence.dao.jpa;
+
+import com.franciaflex.magalie.persistence.dao.PreparedArticleReceptionDao;
+import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class PreparedArticleReceptionJpaDao extends AbstractJpaDao<PreparedArticleReception> implements PreparedArticleReceptionDao {
+
+ public PreparedArticleReceptionJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ protected Class<PreparedArticleReception> getEntityClass() {
+ return PreparedArticleReception.class;
+ }
+
+ @Override
+ public PreparedArticleReception findByBarcode(String barcode) {
+ TypedQuery<PreparedArticleReception> query = createQuery("from PreparedArticleReception par where par.barcode = :barcode");
+ query.setParameter("barcode", barcode);
+ return findUniqueOrNull(query);
+ }
+}
Added: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/PreparedArticleReception.java
===================================================================
--- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/PreparedArticleReception.java (rev 0)
+++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/PreparedArticleReception.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -0,0 +1,52 @@
+package com.franciaflex.magalie.persistence.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+
+@Entity
+public class PreparedArticleReception extends AbstractEntity {
+
+ @Id
+ protected String id;
+
+ protected String barcode;
+
+ @ManyToOne
+ protected StoredArticle storedArticle;
+
+ protected double quantity;
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getBarcode() {
+ return barcode;
+ }
+
+ public void setBarcode(String barcode) {
+ this.barcode = barcode;
+ }
+
+ public StoredArticle getStoredArticle() {
+ return storedArticle;
+ }
+
+ public void setStoredArticle(StoredArticle storedArticle) {
+ this.storedArticle = storedArticle;
+ }
+
+ public double getQuantity() {
+ return quantity;
+ }
+
+ public void setQuantity(double quantity) {
+ this.quantity = quantity;
+ }
+}
Modified: trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/MagalieFixtures.java
===================================================================
--- trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/MagalieFixtures.java 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/MagalieFixtures.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -31,6 +31,7 @@
import com.franciaflex.magalie.persistence.entity.Kanban;
import com.franciaflex.magalie.persistence.entity.Location;
import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
import com.franciaflex.magalie.persistence.entity.RequestedArticle;
import com.franciaflex.magalie.persistence.entity.RequestedList;
import com.franciaflex.magalie.persistence.entity.StoredArticle;
@@ -67,6 +68,7 @@
reader.getConfig().setClassTag("requested-article", RequestedArticle.class);
reader.getConfig().setClassTag("requested-list", RequestedList.class);
reader.getConfig().setClassTag("location", Location.class);
+ reader.getConfig().setClassTag("prepared-article-reception", PreparedArticleReception.class);
try {
fixtures = (Map<String, Object>) reader.read();
} catch (YamlException e) {
Modified: trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/FixturesService.java
===================================================================
--- trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/FixturesService.java 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/FixturesService.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -29,6 +29,7 @@
import com.franciaflex.magalie.persistence.dao.KanbanDao;
import com.franciaflex.magalie.persistence.dao.LocationDao;
import com.franciaflex.magalie.persistence.dao.MagalieUserDao;
+import com.franciaflex.magalie.persistence.dao.PreparedArticleReceptionDao;
import com.franciaflex.magalie.persistence.dao.RequestedArticleDao;
import com.franciaflex.magalie.persistence.dao.RequestedListDao;
import com.franciaflex.magalie.persistence.dao.StoredArticleDao;
@@ -39,6 +40,7 @@
import com.franciaflex.magalie.persistence.entity.Kanban;
import com.franciaflex.magalie.persistence.entity.Location;
import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
import com.franciaflex.magalie.persistence.entity.RequestedArticle;
import com.franciaflex.magalie.persistence.entity.RequestedList;
import com.franciaflex.magalie.persistence.entity.StoredArticle;
@@ -220,6 +222,18 @@
persistenceContext.commit();
+ PreparedArticleReceptionDao preparedArticleReceptionDao = persistenceContext.getPreparedArticleReceptionDao();
+
+ Collection<PreparedArticleReception> preparedArticleReceptions = fixtures.fixture("preparedArticleReceptions");
+
+ for (PreparedArticleReception preparedArticleReception : preparedArticleReceptions) {
+
+ preparedArticleReceptionDao.persist(preparedArticleReception);
+
+ }
+
+ persistenceContext.commit();
+
}
return fixtures;
Modified: trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ReceptionService.java
===================================================================
--- trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ReceptionService.java 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ReceptionService.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -28,12 +28,14 @@
import com.franciaflex.magalie.persistence.StorageMovements;
import com.franciaflex.magalie.persistence.StoredArticles;
import com.franciaflex.magalie.persistence.dao.LocationDao;
+import com.franciaflex.magalie.persistence.dao.PreparedArticleReceptionDao;
import com.franciaflex.magalie.persistence.dao.StorageMovementDao;
import com.franciaflex.magalie.persistence.dao.StoredArticleDao;
import com.franciaflex.magalie.persistence.entity.Article;
import com.franciaflex.magalie.persistence.entity.Building;
import com.franciaflex.magalie.persistence.entity.Location;
import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
import com.franciaflex.magalie.persistence.entity.StorageMovement;
import com.franciaflex.magalie.persistence.entity.StoredArticle;
import com.franciaflex.magalie.persistence.entity.Supplier;
@@ -151,14 +153,37 @@
StoredArticle storedArticle =
storedArticleDao.findById(storedArticleId);
+ // FIXME brendan 23/05/13 déduire de la quantité les mouvements de stocks
+
+ double quantity = storedArticle.getQuantity();
+
+ ReceptionTask receptionTask = buildReceptionTask(storedArticle, quantity);
+
+ return receptionTask;
+
+ }
+
+ protected ReceptionTask buildReceptionTask(StoredArticle storedArticle, double quantity) {
+
Article article = storedArticle.getArticle();
Warehouse warehouse = storedArticle.getLocation().getWarehouse();
List<Location> locations = findLocationsToReceiveArticle(warehouse, article);
- ReceptionTask receptionTask = new ReceptionTask(storedArticle, locations);
+ return new ReceptionTask(storedArticle, quantity, locations);
+ }
+
+ public ReceptionTask getReceptionTaskForPreparedArticleReception(String barcode) {
+
+ PreparedArticleReception preparedArticleReception =
+ getPreparedArticleReception(barcode);
+
+ ReceptionTask receptionTask = buildReceptionTask(
+ preparedArticleReception.getStoredArticle(),
+ preparedArticleReception.getQuantity());
+
return receptionTask;
}
@@ -273,4 +298,19 @@
}
+ public PreparedArticleReception getPreparedArticleReception(String barcode) {
+
+ MagaliePersistenceContext persistenceContext =
+ serviceContext.getPersistenceContext();
+
+ PreparedArticleReceptionDao dao =
+ persistenceContext.getPreparedArticleReceptionDao();
+
+ PreparedArticleReception preparedArticleReception =
+ dao.findByBarcode(barcode);
+
+ return preparedArticleReception;
+
+ }
+
}
Modified: trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ReceptionTask.java
===================================================================
--- trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ReceptionTask.java 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ReceptionTask.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -32,10 +32,13 @@
protected StoredArticle storedArticle;
+ protected double quantity;
+
protected List<Location> locations;
- public ReceptionTask(StoredArticle storedArticle, List<Location> locations) {
+ public ReceptionTask(StoredArticle storedArticle, double quantity, List<Location> locations) {
this.storedArticle = storedArticle;
+ this.quantity = quantity;
this.locations = locations;
}
@@ -46,4 +49,8 @@
public List<Location> getLocations() {
return locations;
}
+
+ public double getQuantity() {
+ return quantity;
+ }
}
Modified: trunk/magalie-services/src/main/resources/fixtures.yaml
===================================================================
--- trunk/magalie-services/src/main/resources/fixtures.yaml 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-services/src/main/resources/fixtures.yaml 2013-05-23 16:25:34 UTC (rev 189)
@@ -632,3 +632,30 @@
- *requestedArticle4
- *requestedArticle5
- *requestedArticle6
+
+preparedArticleReception1:
+ &preparedArticleReception1 !prepared-article-reception
+ id: preparedArticleReception1
+ barcode: PAR1
+ storedArticle: *storedArticleRec1
+ quantity: 3
+
+preparedArticleReception2:
+ &preparedArticleReception2 !prepared-article-reception
+ id: preparedArticleReception2
+ barcode: PAR2
+ storedArticle: *storedArticleRec1
+ quantity: 4
+
+preparedArticleReception3:
+ &preparedArticleReception3 !prepared-article-reception
+ id: preparedArticleReception3
+ barcode: PAR3
+ storedArticle: *storedArticleRec1
+ quantity: 3
+
+preparedArticleReceptions:
+ - *preparedArticleReception1
+ - *preparedArticleReception2
+ - *preparedArticleReception3
+
Modified: trunk/magalie-services/src/main/resources/fixtures2.yaml
===================================================================
--- trunk/magalie-services/src/main/resources/fixtures2.yaml 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-services/src/main/resources/fixtures2.yaml 2013-05-23 16:25:34 UTC (rev 189)
@@ -315,3 +315,5 @@
requestedArticles:
- *requestedArticle1
- *requestedArticle2
+
+preparedArticleReceptions: []
Added: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PreparePreparedArticleReceptionAction.java
===================================================================
--- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PreparePreparedArticleReceptionAction.java (rev 0)
+++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PreparePreparedArticleReceptionAction.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -0,0 +1,47 @@
+package com.franciaflex.magalie.web.action;
+
+import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
+import com.franciaflex.magalie.services.service.ReceptionService;
+import com.franciaflex.magalie.web.MagalieActionSupport;
+import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.convention.annotation.Results;
+
+@Results({
+ @Result(name="success", type="redirectAction", params = { "actionName", "receive-article!input", "preparedArticleReceptionBarcode", "${barcode}" })
+})
+public class PreparePreparedArticleReceptionAction extends MagalieActionSupport {
+
+ protected ReceptionService receptionService;
+
+ protected String barcode;
+
+ public void setReceptionService(ReceptionService receptionService) {
+ this.receptionService = receptionService;
+ }
+
+ public void setBarcode(String barcode) {
+ this.barcode = barcode;
+ }
+
+ @Override
+ public String execute() {
+
+ PreparedArticleReception preparedArticleReception =
+ receptionService.getPreparedArticleReception(barcode);
+
+ if (preparedArticleReception == null) {
+
+ addFieldError("barcode", "Ce n'est pas un code-barre valide");
+
+ return INPUT;
+
+ }
+
+ return SUCCESS;
+
+ }
+
+ public String getBarcode() {
+ return barcode;
+ }
+}
Modified: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/ReceiveArticleAction.java
===================================================================
--- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/ReceiveArticleAction.java 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/ReceiveArticleAction.java 2013-05-23 16:25:34 UTC (rev 189)
@@ -30,6 +30,7 @@
import com.franciaflex.magalie.services.service.ReceptionTask;
import com.franciaflex.magalie.web.MagalieActionSupport;
import com.franciaflex.magalie.web.MagalieSession;
+import com.google.common.base.Preconditions;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Result;
@@ -53,6 +54,8 @@
protected String storedArticleId;
+ protected String preparedArticleReceptionBarcode;
+
protected ReceptionTask receptionTask;
protected ReceptionConfirmation confirmation;
@@ -69,11 +72,27 @@
this.storedArticleId = storedArticleId;
}
+ public void setPreparedArticleReceptionBarcode(String preparedArticleReceptionBarcode) {
+ this.preparedArticleReceptionBarcode = preparedArticleReceptionBarcode;
+ }
+
@Override
public String input() {
- receptionTask = service.getReceptionTask(storedArticleId);
+ if (storedArticleId != null) {
+ receptionTask = service.getReceptionTask(storedArticleId);
+
+ }
+
+ if (preparedArticleReceptionBarcode != null) {
+
+ receptionTask = service.getReceptionTaskForPreparedArticleReception(preparedArticleReceptionBarcode);
+
+ }
+
+ Preconditions.checkNotNull(receptionTask);
+
return INPUT;
}
Modified: trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp 2013-05-23 16:25:34 UTC (rev 189)
@@ -26,31 +26,19 @@
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<s:url namespace="/" action="fulfil-kanban!input" id="fulfilKanbanUrl"/>
-<s:url namespace="/" action="deliver-requested-article!input" id="deliverRequestedArticleUrl"/>
-<s:url namespace="/" action="prepare-article-reception!input" id="prepareArticleReceptionUrl"/>
-<s:if test="movementOrderResume" >
- <s:url namespace="/" action="withdraw-item!input" id="movementOrderResumeUrl">
- <s:param name="storageMovementOrderId" value="%{movementOrderResume.id}" />
- </s:url>
-</s:if>
-
-<s:url namespace="/" action="logout" id="logoutUrl"/>
-
<head>
-<script>
-$(document).ready(function() {
- bindKey('1', function(){ redirectTo($('#fulfilKanbanLink'));});
- bindKey('2', function(){ redirectTo($('#deliverRequestedArticleLink'));});
- bindKey('3', function(){ redirectTo($('#prepareArticleReceptionLink'));});
- <s:if test="movementOrderResume" >
- bindKey('4', function(){ redirectTo($('#movementOrderResumeLink'));});
- </s:if>
- bindKey('Esc', function(){ redirectTo($('#logoutLink'));});
-});
-
-</script>
-
+ <script>
+ $(document).ready(function() {
+ bindKey('1', function(){ redirectTo($('#fulfilKanbanLink'));});
+ bindKey('2', function(){ redirectTo($('#deliverRequestedArticleLink'));});
+ bindKey('3', function(){ redirectTo($('#prepareArticleReceptionLink'));});
+ bindKey('4', function(){ redirectTo($('#preparePreparedArticleReceptionLink'));});
+ <s:if test="movementOrderResume" >
+ bindKey('5', function(){ redirectTo($('#movementOrderResumeLink'));});
+ </s:if>
+ bindKey('Esc', function(){ redirectTo($('#logoutLink'));});
+ });
+ </script>
</head>
<header>
@@ -62,10 +50,24 @@
</dl>
</header>
+<s:url namespace="/" action="fulfil-kanban!input" id="fulfilKanbanUrl"/>
<s:a href="%{fulfilKanbanUrl}" cssClass="btn btn-block" id="fulfilKanbanLink">Traiter kanbans (1)</s:a>
+
+<s:url namespace="/" action="deliver-requested-article!input" id="deliverRequestedArticleUrl"/>
<s:a href="%{deliverRequestedArticleUrl}" cssClass="btn btn-block" id="deliverRequestedArticleLink">Traiter listes à servir (2)</s:a>
+
+<s:url namespace="/" action="prepare-article-reception!input" id="prepareArticleReceptionUrl"/>
<s:a href="%{prepareArticleReceptionUrl}" cssClass="btn btn-block" id="prepareArticleReceptionLink" >Traiter les réceptions fournisseurs (3)</s:a>
+
+<s:url namespace="/" action="prepare-prepared-article-reception!input" id="preparePreparedArticleReceptionUrl"/>
+<s:a href="%{preparePreparedArticleReceptionUrl}" cssClass="btn btn-block" id="preparePreparedArticleReceptionLink" >Traiter les réceptions fournisseurs préparées (4)</s:a>
+
<s:if test="movementOrderResume" >
- <s:a href="%{movementOrderResumeUrl}" cssClass="btn btn-block" id="movementOrderResumeLink" >Reprendre l'ordre de mouvement (4)</s:a>
+ <s:url namespace="/" action="withdraw-item!input" id="movementOrderResumeUrl">
+ <s:param name="storageMovementOrderId" value="%{movementOrderResume.id}" />
+ </s:url>
+ <s:a href="%{movementOrderResumeUrl}" cssClass="btn btn-block" id="movementOrderResumeLink" >Reprendre l'ordre de mouvement (5)</s:a>
</s:if>
+
+<s:url namespace="/" action="logout" id="logoutUrl"/>
<s:a href="%{logoutUrl}" cssClass="btn btn-block" id="logoutLink" >Déconnexion (Esc)</s:a>
Added: trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-prepared-article-reception-input.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-prepared-article-reception-input.jsp (rev 0)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-prepared-article-reception-input.jsp 2013-05-23 16:25:34 UTC (rev 189)
@@ -0,0 +1,25 @@
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<head>
+ <title>Traitement des réceptions préparées</title>
+ <script type="text/javascript">
+ $(document).ready(function () {
+ $("#prepare-prepared-article-reception_barcode").focus();
+ bindKey('Esc', function(){ redirectTo($('#chooseActivityLink'));});
+ });
+ </script>
+</head>
+
+<s:url namespace="/" action="choose-activity" id="chooseActivityUrl"/>
+
+<s:form>
+
+ <s:textfield key="barcode" label="Code réception" inputAppendIcon="barcode" cssClass="input-medium" />
+
+ <div class="btn-group">
+ <s:a href="%{chooseActivityUrl}" cssClass="btn" id="chooseActivityLink" >Changer d'activité (Esc)</s:a>
+ <s:submit name="next" value="Suivant" cssClass="btn btn-primary" />
+ </div>
+
+</s:form>
Modified: trunk/magalie-web/src/main/webapp/WEB-INF/content/receive-article-input.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/receive-article-input.jsp 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/receive-article-input.jsp 2013-05-23 16:25:34 UTC (rev 189)
@@ -39,7 +39,7 @@
<dt>Desc.</dt>
<dd><s:property value="receptionTask.storedArticle.article.description" /></dd>
<dt>Stocké</dt>
- <dd><span id="stored">0</span> / <s:property value="receptionTask.storedArticle.quantity" /> <s:property value="receptionTask.storedArticle.article.unit" /></dd>
+ <dd><span id="stored">0</span> / <s:property value="receptionTask.quantity" /> <s:property value="receptionTask.storedArticle.article.unit" /></dd>
</dl>
</header>
<section id="locations">
Modified: trunk/magalie-web/src/main/webapp/js/receive-article-input.js
===================================================================
--- trunk/magalie-web/src/main/webapp/js/receive-article-input.js 2013-05-23 15:52:28 UTC (rev 188)
+++ trunk/magalie-web/src/main/webapp/js/receive-article-input.js 2013-05-23 16:25:34 UTC (rev 189)
@@ -33,7 +33,7 @@
};
model.isFulfilled = function() {
- var isFull = this.stored() === this.storedArticle.quantity;
+ var isFull = this.stored() === this.quantity;
return isFull;
};
@@ -72,7 +72,7 @@
};
model.remainingQuantity = function() {
- var remainingQuantity = this.storedArticle.quantity - this.stored();
+ var remainingQuantity = this.quantity - this.stored();
return remainingQuantity;
}
@@ -97,9 +97,9 @@
refreshSummary : function() {
$('#stored').text(model.stored());
- if (model.stored() === model.storedArticle.quantity) {
+ if (model.stored() === model.quantity) {
$('#stored').addClass('success');
- } else if (model.stored() > model.storedArticle.quantity) {
+ } else if (model.stored() > model.quantity) {
$('#stored').addClass('warning');
}
},
1
0
23 May '13
Author: Bavencoff
Date: 2013-05-23 17:52:28 +0200 (Thu, 23 May 2013)
New Revision: 188
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
UML
Modified:
trunk/magalie-persistence/src/main/xmi/magalie.zargo
Modified: trunk/magalie-persistence/src/main/xmi/magalie.zargo
===================================================================
(Binary files differ)
1
0
r187 - trunk/magalie-web/src/main/webapp/WEB-INF/content
by bleny@users.forge.codelutin.com 23 May '13
by bleny@users.forge.codelutin.com 23 May '13
23 May '13
Author: bleny
Date: 2013-05-23 15:51:39 +0200 (Thu, 23 May 2013)
New Revision: 187
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
indent
Modified:
trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-article-reception-input.jsp
Modified: trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-article-reception-input.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-article-reception-input.jsp 2013-05-23 10:56:04 UTC (rev 186)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-article-reception-input.jsp 2013-05-23 13:51:39 UTC (rev 187)
@@ -51,8 +51,8 @@
<li>
<s:set var="prepareArticleReceptionId">prepareArticleReceptionId<s:property value="#stat.index" /></s:set>
<s:url namespace="/" action="prepare-article-reception" id="prepareArticleReceptionUrl">
- <s:param name="supplierId" value="%{id}" />
- </s:url>
+ <s:param name="supplierId" value="%{id}" />
+ </s:url>
<s:if test="#stat.index + 1 < shortcuts.size()">
<script type="text/javascript">
$(document).ready(function () {
1
0
r186 - trunk/magalie-web/src/main/webapp/WEB-INF/content
by bleny@users.forge.codelutin.com 23 May '13
by bleny@users.forge.codelutin.com 23 May '13
23 May '13
Author: bleny
Date: 2013-05-23 12:56:04 +0200 (Thu, 23 May 2013)
New Revision: 186
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
fix bad camelcase
Modified:
trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp
Modified: trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp 2013-05-23 10:39:57 UTC (rev 185)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp 2013-05-23 10:56:04 UTC (rev 186)
@@ -40,13 +40,13 @@
<head>
<script>
$(document).ready(function() {
- bindKey('1', function(){ redirectTo($('#fulfilKanbanlink'));});
- bindKey('2', function(){ redirectTo($('#deliverRequestedArticlelink'));});
- bindKey('3', function(){ redirectTo($('#prepareArticleReceptionlink'));});
+ bindKey('1', function(){ redirectTo($('#fulfilKanbanLink'));});
+ bindKey('2', function(){ redirectTo($('#deliverRequestedArticleLink'));});
+ bindKey('3', function(){ redirectTo($('#prepareArticleReceptionLink'));});
<s:if test="movementOrderResume" >
- bindKey('4', function(){ redirectTo($('#movementOrderResumelink'));});
+ bindKey('4', function(){ redirectTo($('#movementOrderResumeLink'));});
</s:if>
- bindKey('Esc', function(){ redirectTo($('#logoutlink'));});
+ bindKey('Esc', function(){ redirectTo($('#logoutLink'));});
});
</script>
@@ -62,10 +62,10 @@
</dl>
</header>
-<s:a href="%{fulfilKanbanUrl}" cssClass="btn btn-block" id="fulfilKanbanlink">Traiter kanbans (1)</s:a>
-<s:a href="%{deliverRequestedArticleUrl}" cssClass="btn btn-block" id="deliverRequestedArticlelink">Traiter listes à servir (2)</s:a>
-<s:a href="%{prepareArticleReceptionUrl}" cssClass="btn btn-block" id="prepareArticleReceptionlink" >Traiter les réceptions fournisseurs (3)</s:a>
+<s:a href="%{fulfilKanbanUrl}" cssClass="btn btn-block" id="fulfilKanbanLink">Traiter kanbans (1)</s:a>
+<s:a href="%{deliverRequestedArticleUrl}" cssClass="btn btn-block" id="deliverRequestedArticleLink">Traiter listes à servir (2)</s:a>
+<s:a href="%{prepareArticleReceptionUrl}" cssClass="btn btn-block" id="prepareArticleReceptionLink" >Traiter les réceptions fournisseurs (3)</s:a>
<s:if test="movementOrderResume" >
- <s:a href="%{movementOrderResumeUrl}" cssClass="btn btn-block" id="movementOrderResumelink" >Reprendre l'ordre de mouvement (4)</s:a>
+ <s:a href="%{movementOrderResumeUrl}" cssClass="btn btn-block" id="movementOrderResumeLink" >Reprendre l'ordre de mouvement (4)</s:a>
</s:if>
-<s:a href="%{logoutUrl}" cssClass="btn btn-block" id="logoutlink" >Déconnexion (Esc)</s:a>
+<s:a href="%{logoutUrl}" cssClass="btn btn-block" id="logoutLink" >Déconnexion (Esc)</s:a>
1
0
r185 - in trunk: magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa magalie-services/src/main/java/com/franciaflex/magalie/services/service magalie-web/src/main/java/com/franciaflex/magalie/web/action magalie-web/src/main/webapp/WEB-INF/content
by Bavencoff@users.forge.codelutin.com 23 May '13
by Bavencoff@users.forge.codelutin.com 23 May '13
23 May '13
Author: Bavencoff
Date: 2013-05-23 12:39:57 +0200 (Thu, 23 May 2013)
New Revision: 185
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
fixes #2438 : resume movement order
Added:
trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/OrderResumeService.java
Modified:
trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java
trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StorageMovementOrderJpaDao.java
trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/ChooseActivityAction.java
trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp
Modified: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java
===================================================================
--- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java 2013-05-23 07:23:35 UTC (rev 184)
+++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java 2013-05-23 10:39:57 UTC (rev 185)
@@ -23,8 +23,14 @@
* #L%
*/
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
+import java.util.List;
+
public interface StorageMovementOrderDao extends Dao<StorageMovementOrder> {
+ public List<StorageMovementOrder> findNotConfirmedByUser(MagalieUser magalieUser, Building building);
+
}
Modified: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StorageMovementOrderJpaDao.java
===================================================================
--- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StorageMovementOrderJpaDao.java 2013-05-23 07:23:35 UTC (rev 184)
+++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StorageMovementOrderJpaDao.java 2013-05-23 10:39:57 UTC (rev 185)
@@ -24,9 +24,13 @@
*/
import com.franciaflex.magalie.persistence.dao.StorageMovementOrderDao;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.List;
public class StorageMovementOrderJpaDao extends AbstractJpaDao<StorageMovementOrder> implements StorageMovementOrderDao {
@@ -39,4 +43,17 @@
return StorageMovementOrder.class;
}
+ @Override
+ public List<StorageMovementOrder> findNotConfirmedByUser(MagalieUser magalieUser, Building building) {
+ Query query = entityManager.createQuery(
+ " select distinct smo" +
+ " from StorageMovementOrder smo" +
+ " inner join smo.storageMovements as sm" +
+ " where sm.magalieUser = :magalieUser" +
+ " and sm.originLocation.warehouse.building = :building" +
+ " and sm.confirmDate is null" );
+ query.setParameter("magalieUser", magalieUser);
+ query.setParameter("building", building);
+ return query.getResultList();
+ }
}
Added: trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/OrderResumeService.java
===================================================================
--- trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/OrderResumeService.java (rev 0)
+++ trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/OrderResumeService.java 2013-05-23 10:39:57 UTC (rev 185)
@@ -0,0 +1,61 @@
+package com.franciaflex.magalie.services.service;
+
+/*
+ * #%L
+ * MagaLiE :: Services
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+
+import com.franciaflex.magalie.persistence.MagaliePersistenceContext;
+import com.franciaflex.magalie.persistence.dao.StorageMovementOrderDao;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
+import com.franciaflex.magalie.services.MagalieService;
+import com.franciaflex.magalie.services.MagalieServiceContext;
+
+import java.util.List;
+
+public class OrderResumeService implements MagalieService {
+
+ protected MagalieServiceContext serviceContext;
+
+ @Override
+ public void setServiceContext(MagalieServiceContext serviceContext) {
+ this.serviceContext = serviceContext;
+ }
+
+ public StorageMovementOrder findMovementOrderResume(MagalieUser magalieUser, Building building) {
+
+ MagaliePersistenceContext persistenceContext = serviceContext.getPersistenceContext();
+
+ StorageMovementOrderDao storageMovementOrderDao = persistenceContext.getStorageMovementOrderDao();
+
+ List<StorageMovementOrder> notConfirmedByUser = storageMovementOrderDao.findNotConfirmedByUser(magalieUser, building);
+
+ if (notConfirmedByUser.isEmpty()) {
+ return null;
+ } else {
+ return notConfirmedByUser.get(0);
+ }
+ }
+
+}
Modified: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/ChooseActivityAction.java
===================================================================
--- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/ChooseActivityAction.java 2013-05-23 07:23:35 UTC (rev 184)
+++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/ChooseActivityAction.java 2013-05-23 10:39:57 UTC (rev 185)
@@ -25,6 +25,8 @@
import com.franciaflex.magalie.persistence.entity.Building;
import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
+import com.franciaflex.magalie.services.service.OrderResumeService;
import com.franciaflex.magalie.web.MagalieActionSupport;
import com.franciaflex.magalie.web.MagalieSession;
@@ -36,10 +38,18 @@
protected Building building;
+ protected OrderResumeService service;
+
+ protected StorageMovementOrder movementOrderResume;
+
public void setSession(MagalieSession session) {
this.session = session;
}
+ public void setService(OrderResumeService service) {
+ this.service = service;
+ }
+
@Override
public String execute() throws Exception {
@@ -47,6 +57,8 @@
building = session.getBuilding();
+ movementOrderResume = service.findMovementOrderResume(magalieUser, building);
+
return SUCCESS;
}
@@ -58,4 +70,13 @@
public Building getBuilding() {
return building;
}
+
+ public StorageMovementOrder getMovementOrderResume() {
+ return movementOrderResume;
+ }
+
+ public OrderResumeService getService() {
+ return service;
+ }
+
}
Modified: trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp 2013-05-23 07:23:35 UTC (rev 184)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp 2013-05-23 10:39:57 UTC (rev 185)
@@ -29,6 +29,12 @@
<s:url namespace="/" action="fulfil-kanban!input" id="fulfilKanbanUrl"/>
<s:url namespace="/" action="deliver-requested-article!input" id="deliverRequestedArticleUrl"/>
<s:url namespace="/" action="prepare-article-reception!input" id="prepareArticleReceptionUrl"/>
+<s:if test="movementOrderResume" >
+ <s:url namespace="/" action="withdraw-item!input" id="movementOrderResumeUrl">
+ <s:param name="storageMovementOrderId" value="%{movementOrderResume.id}" />
+ </s:url>
+</s:if>
+
<s:url namespace="/" action="logout" id="logoutUrl"/>
<head>
@@ -37,6 +43,9 @@
bindKey('1', function(){ redirectTo($('#fulfilKanbanlink'));});
bindKey('2', function(){ redirectTo($('#deliverRequestedArticlelink'));});
bindKey('3', function(){ redirectTo($('#prepareArticleReceptionlink'));});
+ <s:if test="movementOrderResume" >
+ bindKey('4', function(){ redirectTo($('#movementOrderResumelink'));});
+ </s:if>
bindKey('Esc', function(){ redirectTo($('#logoutlink'));});
});
@@ -56,4 +65,7 @@
<s:a href="%{fulfilKanbanUrl}" cssClass="btn btn-block" id="fulfilKanbanlink">Traiter kanbans (1)</s:a>
<s:a href="%{deliverRequestedArticleUrl}" cssClass="btn btn-block" id="deliverRequestedArticlelink">Traiter listes à servir (2)</s:a>
<s:a href="%{prepareArticleReceptionUrl}" cssClass="btn btn-block" id="prepareArticleReceptionlink" >Traiter les réceptions fournisseurs (3)</s:a>
+<s:if test="movementOrderResume" >
+ <s:a href="%{movementOrderResumeUrl}" cssClass="btn btn-block" id="movementOrderResumelink" >Reprendre l'ordre de mouvement (4)</s:a>
+</s:if>
<s:a href="%{logoutUrl}" cssClass="btn btn-block" id="logoutlink" >Déconnexion (Esc)</s:a>
1
0
r184 - trunk/magalie-web/src/main/webapp/WEB-INF/content
by Bavencoff@users.forge.codelutin.com 23 May '13
by Bavencoff@users.forge.codelutin.com 23 May '13
23 May '13
Author: Bavencoff
Date: 2013-05-23 09:23:35 +0200 (Thu, 23 May 2013)
New Revision: 184
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
refs #2454 : Cancel mouvement order
Modified:
trunk/magalie-web/src/main/webapp/WEB-INF/content/fulfil-kanban-input.jsp
Modified: trunk/magalie-web/src/main/webapp/WEB-INF/content/fulfil-kanban-input.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/fulfil-kanban-input.jsp 2013-05-23 07:19:13 UTC (rev 183)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/fulfil-kanban-input.jsp 2013-05-23 07:23:35 UTC (rev 184)
@@ -50,8 +50,8 @@
<s:textfield name="quantity" label="Qté" inputAppend="%{article.unit}" cssClass="input-mini" />
</s:if>
- <div>
+ <div class="btn-group">
+ <s:a href="%{chooseActivityUrl}" cssClass="btn" id="chooseActivityLink" >Changer d'activité (Esc)</s:a>
<s:submit name="next" value="Suivant" cssClass="btn btn-primary" />
- <s:a href="%{chooseActivityUrl}" cssClass="btn" id="chooseActivityLink" >Changer d'activité (Esc)</s:a>
</div>
</s:form>
\ No newline at end of file
1
0