fix update product

This commit is contained in:
prgres 2019-01-23 21:46:45 +01:00
parent 329d3349af
commit da5eb0e87b
4 changed files with 123 additions and 89 deletions

View File

@ -1,9 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="2dc093a7-8382-4e31-b457-ce6c9fd10d13" name="Default Changelist" comment="fix default page size in /get-all"> <list default="true" id="2dc093a7-8382-4e31-b457-ce6c9fd10d13" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java" afterDir="false" />
</list> </list>
<ignored path="$PROJECT_DIR$/target/" /> <ignored path="$PROJECT_DIR$/target/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@ -73,6 +75,29 @@
<item name="tables" type="d4e8921:DatabaseStructure$FamilyGroup" /> <item name="tables" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="product: table" type="69fad909:PgImplModel$LocalTable" /> <item name="product: table" type="69fad909:PgImplModel$LocalTable" />
</path> </path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="heroku" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="d3e1jrm08qe91q: database" type="162271b6:PgImplModel$Database" />
<item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="public: schema" type="983ebcf7:PgImplModel$Schema" />
<item name="sequences" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="heroku" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="d3e1jrm08qe91q: database" type="162271b6:PgImplModel$Database" />
<item name="access methods" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="heroku" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="d3e1jrm08qe91q: database" type="162271b6:PgImplModel$Database" />
<item name="extensions" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
</expand> </expand>
<select /> <select />
</component> </component>
@ -81,8 +106,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java"> <entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="138"> <state relative-caret-position="199">
<caret line="59" column="28" selection-start-line="59" selection-start-column="28" selection-end-line="59" selection-end-column="28" /> <caret line="88" selection-start-line="88" selection-end-line="88" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -105,8 +130,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java"> <entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="208"> <state relative-caret-position="378">
<caret line="82" column="38" selection-start-line="82" selection-start-column="38" selection-end-line="82" selection-end-column="38" /> <caret line="93" column="63" lean-forward="true" selection-start-line="93" selection-start-column="63" selection-end-line="93" selection-end-column="63" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -117,7 +142,7 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validator/ProductValidator.java"> <entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validator/ProductValidator.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465"> <state relative-caret-position="426">
<caret line="38" column="16" selection-start-line="38" selection-start-column="16" selection-end-line="38" selection-end-column="16" /> <caret line="38" column="16" selection-start-line="38" selection-start-column="16" selection-end-line="38" selection-end-column="16" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
@ -126,23 +151,14 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="6" column="31" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/README.md"> <entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]"> <provider selected="true" editor-type-id="text-editor">
<state split_layout="SPLIT"> <state relative-caret-position="272">
<first_editor relative-caret-position="765"> <caret line="41" column="26" selection-start-line="41" selection-start-column="26" selection-end-line="41" selection-end-column="26" />
<caret line="51" lean-forward="true" selection-start-line="51" selection-end-line="51" /> <folding>
</first_editor> <element signature="imports" expanded="true" />
<second_editor /> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -190,13 +206,13 @@
<option value="$APPLICATION_CONFIG_DIR$/consoles/db/4eb55351-864c-4d3f-b24d-048a158530c7/console.sql" /> <option value="$APPLICATION_CONFIG_DIR$/consoles/db/4eb55351-864c-4d3f-b24d-048a158530c7/console.sql" />
<option value="$PROJECT_DIR$/pom.xml" /> <option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/.gitignore" /> <option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validator/ProductValidator.java" /> <option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validator/ProductValidator.java" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductService.java" /> <option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductService.java" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java" /> <option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java" /> <option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java" />
</list> </list>
</option> </option>
</component> </component>
@ -223,8 +239,7 @@
<select /> <select />
</treeState> </treeState>
</component> </component>
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="840" />
<option name="y" value="23" /> <option name="y" value="23" />
<option name="width" value="840" /> <option name="width" value="840" />
<option name="height" value="1027" /> <option name="height" value="1027" />
@ -237,7 +252,6 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="PackagesPane" /> <pane id="PackagesPane" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
@ -328,6 +342,7 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -413,7 +428,8 @@
<updated>1547322958782</updated> <updated>1547322958782</updated>
<workItem from="1547322960420" duration="21872000" /> <workItem from="1547322960420" duration="21872000" />
<workItem from="1547401179909" duration="33384000" /> <workItem from="1547401179909" duration="33384000" />
<workItem from="1548159944175" duration="16692000" /> <workItem from="1548159944175" duration="16987000" />
<workItem from="1548273577966" duration="2213000" />
</task> </task>
<task id="LOCAL-00001" summary="added quantityChange validation, product validation, checking existing object in db, throwing exeption"> <task id="LOCAL-00001" summary="added quantityChange validation, product validation, checking existing object in db, throwing exeption">
<created>1548121370553</created> <created>1548121370553</created>
@ -492,11 +508,18 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1548184896657</updated> <updated>1548184896657</updated>
</task> </task>
<option name="localTasksCounter" value="12" /> <task id="LOCAL-00012" summary="fix readme">
<created>1548238865354</created>
<option name="number" value="00012" />
<option name="presentableId" value="LOCAL-00012" />
<option name="project" value="LOCAL" />
<updated>1548238865354</updated>
</task>
<option name="localTasksCounter" value="13" />
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="71948000" /> <option name="totallyTimeSpent" value="74456000" />
</component> </component>
<component name="TodoView"> <component name="TodoView">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
@ -508,10 +531,9 @@
</todo-panel> </todo-panel>
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="23" width="1680" height="1027" extended-state="0" /> <frame x="0" y="23" width="1680" height="1027" extended-state="6" />
<editor active="true" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.49810606" weight="0.18131869" /> <window_info content_ui="combo" id="Project" order="0" sideWeight="0.49810606" visible="true" weight="0.18131869" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" /> <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Designer" order="2" /> <window_info id="Designer" order="2" />
<window_info id="UI Designer" order="3" /> <window_info id="UI Designer" order="3" />
@ -520,12 +542,12 @@
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" sideWeight="0.498779" weight="0.32941177" /> <window_info anchor="bottom" id="Find" order="1" sideWeight="0.498779" weight="0.32941177" />
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.498779" weight="0.3315508" /> <window_info anchor="bottom" id="Run" order="2" sideWeight="0.498779" weight="0.3315508" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" /> <window_info anchor="bottom" id="Debug" order="3" visible="true" weight="0.46203208" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" /> <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" /> <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32941177" /> <window_info anchor="bottom" id="TODO" order="6" weight="0.32941177" />
<window_info anchor="bottom" id="Spring" order="7" sideWeight="0.4993895" weight="0.32941177" /> <window_info anchor="bottom" id="Spring" order="7" sideWeight="0.4993895" weight="0.32941177" />
<window_info anchor="bottom" id="Terminal" order="8" sideWeight="0.497558" weight="0.7326203" /> <window_info anchor="bottom" id="Terminal" order="8" sideWeight="0.497558" weight="0.3657754" />
<window_info anchor="bottom" id="Docker" order="9" show_stripe_button="false" /> <window_info anchor="bottom" id="Docker" order="9" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="10" sideWeight="0.502442" side_tool="true" weight="0.44919786" /> <window_info anchor="bottom" id="Event Log" order="10" sideWeight="0.502442" side_tool="true" weight="0.44919786" />
<window_info anchor="bottom" id="Messages" order="11" weight="0.32941177" /> <window_info anchor="bottom" id="Messages" order="11" weight="0.32941177" />
@ -539,7 +561,7 @@
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" /> <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Maven" order="3" weight="0.32967034" /> <window_info anchor="right" id="Maven" order="3" weight="0.32967034" />
<window_info anchor="right" id="Palette" order="4" /> <window_info anchor="right" id="Palette" order="4" />
<window_info anchor="right" id="Database" order="5" weight="0.6466165" /> <window_info active="true" anchor="right" id="Database" order="5" visible="true" weight="0.4041514" />
<window_info anchor="right" id="Palette&#9;" order="6" /> <window_info anchor="right" id="Palette&#9;" order="6" />
<window_info anchor="right" id="Bean Validation" order="7" /> <window_info anchor="right" id="Bean Validation" order="7" />
</layout> </layout>
@ -602,11 +624,24 @@
<MESSAGE value="fix changeQuantity" /> <MESSAGE value="fix changeQuantity" />
<MESSAGE value="update readme.md" /> <MESSAGE value="update readme.md" />
<MESSAGE value="fix default page size in /get-all" /> <MESSAGE value="fix default page size in /get-all" />
<option name="LAST_COMMIT_MESSAGE" value="fix default page size in /get-all" /> <MESSAGE value="fix readme" />
<option name="LAST_COMMIT_MESSAGE" value="fix readme" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" /> <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" /> <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REARRANGE_BEFORE_PROJECT_COMMIT" value="true" /> <option name="REARRANGE_BEFORE_PROJECT_COMMIT" value="true" />
</component> </component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java</url>
<line>90</line>
<properties />
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-autoconfigure/2.1.2.RELEASE/spring-boot-autoconfigure-2.1.2.RELEASE.jar!/org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration.class"> <entry file="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-autoconfigure/2.1.2.RELEASE/spring-boot-autoconfigure-2.1.2.RELEASE.jar!/org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration.class">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
@ -724,16 +759,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="693">
<caret line="54" column="74" selection-start-line="54" selection-start-column="74" selection-end-line="54" selection-end-column="74" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/springframework/data/spring-data-commons/2.1.4.RELEASE/spring-data-commons-2.1.4.RELEASE.jar!/org/springframework/data/domain/Pageable.class"> <entry file="jar://$MAVEN_REPOSITORY$/org/springframework/data/spring-data-commons/2.1.4.RELEASE/spring-data-commons-2.1.4.RELEASE.jar!/org/springframework/data/domain/Pageable.class">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285"> <state relative-caret-position="285">
@ -748,30 +773,27 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductService.java"> <entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state relative-caret-position="345"> <state split_layout="SPLIT">
<caret line="23" selection-start-line="23" selection-end-line="23" /> <first_editor relative-caret-position="321">
<folding> <caret line="114" column="26" selection-start-line="114" selection-start-column="26" selection-end-line="114" selection-end-column="26" />
<element signature="imports" expanded="true" /> </first_editor>
</folding> <second_editor />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java"> <entry file="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.1.4.RELEASE/spring-aop-5.1.4.RELEASE.jar!/org/springframework/aop/framework/JdkDynamicAopProxy.class">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="208"> <state relative-caret-position="178">
<caret line="82" column="38" selection-start-line="82" selection-start-column="38" selection-end-line="82" selection-end-column="38" /> <caret line="84" selection-start-line="84" selection-end-line="84" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validator/ProductValidator.java"> <entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465"> <state relative-caret-position="199">
<caret line="38" column="16" selection-start-line="38" selection-start-column="16" selection-end-line="38" selection-end-column="16" /> <caret line="88" selection-start-line="88" selection-end-line="88" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -785,23 +807,43 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java"> <entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductService.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="138"> <state relative-caret-position="345">
<caret line="59" column="28" selection-start-line="59" selection-start-column="28" selection-end-line="59" selection-end-column="28" /> <caret line="23" selection-start-line="23" selection-end-line="23" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/README.md"> <entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validator/ProductValidator.java">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]"> <provider selected="true" editor-type-id="text-editor">
<state split_layout="SPLIT"> <state relative-caret-position="426">
<first_editor relative-caret-position="765"> <caret line="38" column="16" selection-start-line="38" selection-start-column="16" selection-end-line="38" selection-end-column="16" />
<caret line="51" lean-forward="true" selection-start-line="51" selection-end-line="51" /> <folding>
</first_editor> <element signature="imports" expanded="true" />
<second_editor /> </folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="378">
<caret line="93" column="63" lean-forward="true" selection-start-line="93" selection-start-column="63" selection-end-line="93" selection-end-column="63" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="41" column="26" selection-start-line="41" selection-start-column="26" selection-end-line="41" selection-end-column="26" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>

View File

@ -40,12 +40,12 @@ public class Product {
@NotNull(message = "quantity cannot be null") @NotNull(message = "quantity cannot be null")
@Min(value = 0, message = "quantity cannot be under 0") @Min(value = 0, message = "quantity cannot be under 0")
@Column(name = "quantity") @Column(name = "quantity")
private long quantity; private Long quantity;
@NotNull(message = "quantityMax cannot be null") @NotNull(message = "quantityMax cannot be null")
@Min(value = 1, message = "quantityMax cannot be under 1") @Min(value = 1, message = "quantityMax cannot be under 1")
@Column(name = "quantityMax") @Column(name = "quantityMax")
private long quantityMax; private Long quantityMax;
@NotNull(message = "image_link cannot be null") @NotNull(message = "image_link cannot be null")
@Column(name = "image_link") @Column(name = "image_link")

View File

@ -1,8 +0,0 @@
package com.dino.scrum.sysmag.repository;
/**
* Created by prgres on 2019-01-23.
*/
public class CrudRepositoryImpl {
}

View File

@ -93,16 +93,16 @@ public class ProductServiceImpl implements ProductService {
if (productReceived.getName() != null) if (productReceived.getName() != null)
productToChange.setName(productReceived.getName()); productToChange.setName(productReceived.getName());
if (productReceived.getName() != null) if (productReceived.getPrice() != null)
productToChange.setPrice(productReceived.getPrice()); productToChange.setPrice(productReceived.getPrice());
if (productReceived.getName() != null) if (productReceived.getQuantity() != null)
productToChange.setQuantity(productReceived.getQuantity()); productToChange.setQuantity(productReceived.getQuantity());
if (productReceived.getName() != null) if (productReceived.getQuantityMax() != null)
productToChange.setQuantityMax(productReceived.getQuantityMax()); productToChange.setQuantityMax(productReceived.getQuantityMax());
if (productReceived.getName() != null) if (productReceived.getImageLink() != null)
productToChange.setImageLink(productReceived.getImageLink()); productToChange.setImageLink(productReceived.getImageLink());
productRepository.save(productToChange); productRepository.save(productToChange);