From 329d3349af81c32c1f0c303231a6b732e590de09 Mon Sep 17 00:00:00 2001 From: prgres Date: Wed, 23 Jan 2019 11:21:05 +0100 Subject: [PATCH 1/3] fix readme --- .idea/workspace.xml | 202 +++++++++++------- README.md | 18 +- .../sysmag/repository/CrudRepositoryImpl.java | 8 + 3 files changed, 143 insertions(+), 85 deletions(-) create mode 100644 src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fb65724..419b876 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,11 +1,9 @@ - + + - - - asc + Object + + T + @@ -220,7 +223,8 @@ @@ -81,8 +106,8 @@ - - + + @@ -105,8 +130,8 @@ - - + + @@ -117,7 +142,7 @@ - + @@ -126,23 +151,14 @@ - - - - - - - - - - - - - - - - + + + + + + + @@ -190,13 +206,13 @@ @@ -223,8 +239,7 @@ + @@ -413,7 +428,8 @@ 1547322958782 - + + 1548121370553 @@ -492,11 +508,18 @@ - - @@ -508,10 +531,9 @@ - - + - + @@ -520,12 +542,12 @@ - + - + @@ -539,7 +561,7 @@ - + @@ -602,11 +624,24 @@ - + + + + + file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java + 90 + + + + + @@ -724,16 +759,6 @@ - - - - - - - - - - @@ -748,30 +773,27 @@ - - - - - - - + + + + + + + - + - - - - - + + - + - - + + @@ -785,23 +807,43 @@ - + - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/dino/scrum/sysmag/model/Product.java b/src/main/java/com/dino/scrum/sysmag/model/Product.java index ba9b301..813f2d5 100644 --- a/src/main/java/com/dino/scrum/sysmag/model/Product.java +++ b/src/main/java/com/dino/scrum/sysmag/model/Product.java @@ -40,12 +40,12 @@ public class Product { @NotNull(message = "quantity cannot be null") @Min(value = 0, message = "quantity cannot be under 0") @Column(name = "quantity") - private long quantity; + private Long quantity; @NotNull(message = "quantityMax cannot be null") @Min(value = 1, message = "quantityMax cannot be under 1") @Column(name = "quantityMax") - private long quantityMax; + private Long quantityMax; @NotNull(message = "image_link cannot be null") @Column(name = "image_link") diff --git a/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java b/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java deleted file mode 100644 index 7a8f7d2..0000000 --- a/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.dino.scrum.sysmag.repository; - -/** - * Created by prgres on 2019-01-23. - */ - -public class CrudRepositoryImpl { -} diff --git a/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java b/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java index 37fa85f..ec5034e 100644 --- a/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java +++ b/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java @@ -93,16 +93,16 @@ public class ProductServiceImpl implements ProductService { if (productReceived.getName() != null) productToChange.setName(productReceived.getName()); - if (productReceived.getName() != null) + if (productReceived.getPrice() != null) productToChange.setPrice(productReceived.getPrice()); - if (productReceived.getName() != null) + if (productReceived.getQuantity() != null) productToChange.setQuantity(productReceived.getQuantity()); - if (productReceived.getName() != null) + if (productReceived.getQuantityMax() != null) productToChange.setQuantityMax(productReceived.getQuantityMax()); - if (productReceived.getName() != null) + if (productReceived.getImageLink() != null) productToChange.setImageLink(productReceived.getImageLink()); productRepository.save(productToChange); From 1999d4cb123b7e495574d96e95386751e5957e4e Mon Sep 17 00:00:00 2001 From: prgres Date: Wed, 23 Jan 2019 21:56:34 +0100 Subject: [PATCH 3/3] Merge remote-tracking branch 'starskiRepo/backend' # Conflicts: # README.md --- .../java/com/dino/scrum/sysmag/service/ProductServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java b/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java index ec5034e..a14bb99 100644 --- a/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java +++ b/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java @@ -110,6 +110,7 @@ public class ProductServiceImpl implements ProductService { return productRepository.findById(productToChange.getId().longValue()); } + @Override public long count() { return productRepository.count();