Author: bleny Date: 2013-04-26 12:24:21 +0200 (Fri, 26 Apr 2013) New Revision: 144 Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revisions... Log: add a withdrawAllowed column in Warehouse Modified: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StoredArticleJpaDao.java trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Warehouse.java trunk/magalie-services/src/main/resources/fixtures.yaml trunk/magalie-services/src/main/resources/fixtures2.yaml Modified: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StoredArticleJpaDao.java =================================================================== --- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StoredArticleJpaDao.java 2013-04-26 09:50:28 UTC (rev 143) +++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/jpa/StoredArticleJpaDao.java 2013-04-26 10:24:21 UTC (rev 144) @@ -46,7 +46,7 @@ @Override public List<StoredArticle> findAllForArticleInBuilding(Article article, Building building) { - TypedQuery<StoredArticle> query = createQuery("from StoredArticle sa where sa.article = :article and sa.location.warehouse.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); Modified: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Warehouse.java =================================================================== --- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Warehouse.java 2013-04-26 09:50:28 UTC (rev 143) +++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/Warehouse.java 2013-04-26 10:24:21 UTC (rev 144) @@ -38,6 +38,8 @@ @ManyToOne protected Building building; + protected boolean withdrawAllowed; + @Override public String getId() { return id; @@ -62,4 +64,12 @@ public void setCode(String code) { this.code = code; } + + public boolean isWithdrawAllowed() { + return withdrawAllowed; + } + + public void setWithdrawAllowed(boolean withdrawAllowed) { + this.withdrawAllowed = withdrawAllowed; + } } Modified: trunk/magalie-services/src/main/resources/fixtures.yaml =================================================================== --- trunk/magalie-services/src/main/resources/fixtures.yaml 2013-04-26 09:50:28 UTC (rev 143) +++ trunk/magalie-services/src/main/resources/fixtures.yaml 2013-04-26 10:24:21 UTC (rev 144) @@ -51,36 +51,42 @@ id: warehouse_u01 code: U01 building: *B1 + withdrawAllowed: true U02: &U02 !warehouse id: warehouse_u02 code: U02 building: *B1 + withdrawAllowed: true U03: &U03 !warehouse id: warehouse_u03 code: U03 building: *B2 + withdrawAllowed: true U04: &U04 !warehouse id: warehouse_u04 code: U04 building: *B2 + withdrawAllowed: true SOM: &SOM !warehouse id: warehouse_som code: SOM building: *B1 + withdrawAllowed: true B01: &B01 !warehouse id: warehouse_b01 code: B01 building: *B1 + withdrawAllowed: true warehouses: - *U01 Modified: trunk/magalie-services/src/main/resources/fixtures2.yaml =================================================================== --- trunk/magalie-services/src/main/resources/fixtures2.yaml 2013-04-26 09:50:28 UTC (rev 143) +++ trunk/magalie-services/src/main/resources/fixtures2.yaml 2013-04-26 10:24:21 UTC (rev 144) @@ -45,36 +45,42 @@ id: warehouse_u01 code: U01 building: *B1 + withdrawAllowed: true U02: &U02 !warehouse id: warehouse_u02 code: U02 building: *B1 + withdrawAllowed: true U03: &U03 !warehouse id: warehouse_u03 code: U03 building: *B1 + withdrawAllowed: true U04: &U04 !warehouse id: warehouse_u04 code: U04 building: *B1 + withdrawAllowed: true SOM: &SOM !warehouse id: warehouse_som code: SOM building: *B1 + withdrawAllowed: true B01: &B01 !warehouse id: warehouse_b01 code: B01 building: *B1 + withdrawAllowed: true warehouses: - *U01