update repo
This commit is contained in:
parent
647e42507e
commit
4afcb55d8a
124
.idea/uiDesigner.xml
Normal file
124
.idea/uiDesigner.xml
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Palette2">
|
||||||
|
<group name="Swing">
|
||||||
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="Button" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="RadioButton" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="CheckBox" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="Label" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||||
|
<preferred-size width="200" height="200" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||||
|
<preferred-size width="200" height="200" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||||
|
<preferred-size width="-1" height="20" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||||
|
</item>
|
||||||
|
</group>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -1,7 +1,34 @@
|
|||||||
<?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="47c3fbf4-4238-47d3-9ffa-fcd23da4e01e" name="Default Changelist" comment="" />
|
<list default="true" id="47c3fbf4-4238-47d3-9ffa-fcd23da4e01e" name="Default Changelist" comment="">
|
||||||
|
<change afterPath="$PROJECT_DIR$/.idea/uiDesigner.xml" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/model/view/OrderDetailView.java" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/model/view/ProductWithOrderDetail.java" 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/kotlin/com/chantha/jdbc/controller/CustomerController.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/controller/CustomerController.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/controller/OrderController.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/controller/OrderController.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/model/Customer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/model/Customer.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/model/Order.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/model/Order.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/model/OrderDetail.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/model/OrderDetail.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/model/Product.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/model/Product.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/repo/CustomerRepo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/repo/CustomerRepo.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/repo/OrderRepo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/repo/OrderRepo.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/jpa/view/Views.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/META-INF/jdbc.kotlin_module" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/META-INF/jdbc.kotlin_module" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/controller/CustomerController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/controller/CustomerController.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/controller/OrderController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/controller/OrderController.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/model/Customer$GENDER.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/model/Customer$GENDER.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/model/Customer.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/model/Customer.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/model/Order.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/model/Order.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/model/OrderDetail.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/model/OrderDetail.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/model/Product.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/model/Product.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/repo/CustomerRepo.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/repo/CustomerRepo.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/view/Views$Public.class" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/chantha/jdbc/jpa/view/Views.class" beforeDir="false" />
|
||||||
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
@ -11,7 +38,9 @@
|
|||||||
<option name="RECENT_TEMPLATES">
|
<option name="RECENT_TEMPLATES">
|
||||||
<list>
|
<list>
|
||||||
<option value="Interface" />
|
<option value="Interface" />
|
||||||
|
<option value="Kotlin Interface" />
|
||||||
<option value="Kotlin Class" />
|
<option value="Kotlin Class" />
|
||||||
|
<option value="Kotlin File" />
|
||||||
<option value="Class" />
|
<option value="Class" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
@ -21,7 +50,9 @@
|
|||||||
<option name="UPDATE_TYPE" value="MERGE" />
|
<option name="UPDATE_TYPE" value="MERGE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectId" id="1bvsGR0v8LaFrgE2379EYP5rUBj" />
|
<component name="ProjectId" id="1bvsGR0v8LaFrgE2379EYP5rUBj" />
|
||||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
||||||
|
<ConfirmationsSetting value="2" id="Add" />
|
||||||
|
</component>
|
||||||
<component name="ProjectViewState">
|
<component name="ProjectViewState">
|
||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showExcludedFiles" value="true" />
|
<option name="showExcludedFiles" value="true" />
|
||||||
@ -33,13 +64,15 @@
|
|||||||
<property name="RequestMappingsPanelWidth0" value="75" />
|
<property name="RequestMappingsPanelWidth0" value="75" />
|
||||||
<property name="RequestMappingsPanelWidth1" value="75" />
|
<property name="RequestMappingsPanelWidth1" value="75" />
|
||||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||||
|
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
|
||||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||||
<property name="aspect.path.notification.shown" value="true" />
|
<property name="aspect.path.notification.shown" value="true" />
|
||||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/utils" />
|
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/main/kotlin/com/chantha/jdbc/utils/JsonFliter" />
|
||||||
<property name="restartRequiresConfirmation" value="false" />
|
<property name="restartRequiresConfirmation" value="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
|
<recent name="D:\Java\jdbc\src\main\kotlin\com\chantha\jdbc\utils\JsonFliter" />
|
||||||
<recent name="D:\Java\jdbc\src\main\kotlin\com\chantha\jdbc\utils" />
|
<recent name="D:\Java\jdbc\src\main\kotlin\com\chantha\jdbc\utils" />
|
||||||
</key>
|
</key>
|
||||||
</component>
|
</component>
|
||||||
@ -64,7 +97,12 @@
|
|||||||
<updated>1589523805860</updated>
|
<updated>1589523805860</updated>
|
||||||
<workItem from="1589523809207" duration="1223000" />
|
<workItem from="1589523809207" duration="1223000" />
|
||||||
<workItem from="1589525370103" duration="5408000" />
|
<workItem from="1589525370103" duration="5408000" />
|
||||||
<workItem from="1589530809908" duration="7662000" />
|
<workItem from="1589530809908" duration="7941000" />
|
||||||
|
<workItem from="1589594803157" duration="38000" />
|
||||||
|
<workItem from="1589595157824" duration="4891000" />
|
||||||
|
<workItem from="1589600878500" duration="1425000" />
|
||||||
|
<workItem from="1589602595035" duration="1232000" />
|
||||||
|
<workItem from="1589605337172" duration="14720000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
@ -76,53 +114,65 @@
|
|||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state x="552" y="179" key="#Auto_Import/0.0.1920.1040@0.0.1920.1040" timestamp="1589535953579" />
|
<state x="552" y="179" key="#Auto_Import/0.0.1920.1040@0.0.1920.1040" timestamp="1589535953579" />
|
||||||
<state x="765" y="197" key="#com.intellij.ide.util.MemberChooser" timestamp="1589536545607">
|
<state x="690" y="276" key="#com.intellij.codeInsight.editorActions.RestoreReferencesDialog" timestamp="1589601961718">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state x="765" y="197" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1040@0.0.1920.1040" timestamp="1589536545607" />
|
<state x="690" y="276" key="#com.intellij.codeInsight.editorActions.RestoreReferencesDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1589601961718" />
|
||||||
<state x="740" y="276" key="FileChooserDialogImpl" timestamp="1589528576575">
|
<state x="765" y="197" key="#com.intellij.ide.util.MemberChooser" timestamp="1589624306140">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state x="740" y="276" key="FileChooserDialogImpl/0.0.1920.1040@0.0.1920.1040" timestamp="1589528576575" />
|
<state x="765" y="197" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1040@0.0.1920.1040" timestamp="1589624306140" />
|
||||||
<state width="1877" height="501" key="GridCell.Tab.0.bottom" timestamp="1589537916001">
|
<state x="690" y="268" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog" timestamp="1589596932250">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="501" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1589537916001" />
|
<state x="690" y="268" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1589596932250" />
|
||||||
<state width="1877" height="501" key="GridCell.Tab.0.center" timestamp="1589537916001">
|
<state x="739" y="31" key="#org.jetbrains.kotlin.idea.refactoring.move.moveDeclarations.ui.MoveKotlinTopLevelDeclarationsDialog" timestamp="1589608464352">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="501" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1589537916001" />
|
<state x="739" y="31" key="#org.jetbrains.kotlin.idea.refactoring.move.moveDeclarations.ui.MoveKotlinTopLevelDeclarationsDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1589608464352" />
|
||||||
<state width="1877" height="501" key="GridCell.Tab.0.left" timestamp="1589537916000">
|
<state x="740" y="276" key="FileChooserDialogImpl" timestamp="1589607130837">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="501" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1589537916000" />
|
<state x="740" y="276" key="FileChooserDialogImpl/0.0.1920.1040@0.0.1920.1040" timestamp="1589607130837" />
|
||||||
<state width="1877" height="501" key="GridCell.Tab.0.right" timestamp="1589537916001">
|
<state width="1877" height="421" key="GridCell.Tab.0.bottom" timestamp="1589624369020">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="501" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1589537916001" />
|
<state width="1877" height="421" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1589624369020" />
|
||||||
<state width="1877" height="501" key="GridCell.Tab.1.bottom" timestamp="1589537916001">
|
<state width="1877" height="421" key="GridCell.Tab.0.center" timestamp="1589624369020">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="501" key="GridCell.Tab.1.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1589537916001" />
|
<state width="1877" height="421" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1589624369020" />
|
||||||
<state width="1877" height="501" key="GridCell.Tab.1.center" timestamp="1589537916001">
|
<state width="1877" height="421" key="GridCell.Tab.0.left" timestamp="1589624369020">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="501" key="GridCell.Tab.1.center/0.0.1920.1040@0.0.1920.1040" timestamp="1589537916001" />
|
<state width="1877" height="421" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1589624369020" />
|
||||||
<state width="1877" height="501" key="GridCell.Tab.1.left" timestamp="1589537916001">
|
<state width="1877" height="421" key="GridCell.Tab.0.right" timestamp="1589624369020">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="501" key="GridCell.Tab.1.left/0.0.1920.1040@0.0.1920.1040" timestamp="1589537916001" />
|
<state width="1877" height="421" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1589624369020" />
|
||||||
<state width="1877" height="501" key="GridCell.Tab.1.right" timestamp="1589537916001">
|
<state width="1877" height="421" key="GridCell.Tab.1.bottom" timestamp="1589624369020">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="501" key="GridCell.Tab.1.right/0.0.1920.1040@0.0.1920.1040" timestamp="1589537916001" />
|
<state width="1877" height="421" key="GridCell.Tab.1.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1589624369020" />
|
||||||
|
<state width="1877" height="421" key="GridCell.Tab.1.center" timestamp="1589624369020">
|
||||||
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
|
</state>
|
||||||
|
<state width="1877" height="421" key="GridCell.Tab.1.center/0.0.1920.1040@0.0.1920.1040" timestamp="1589624369020" />
|
||||||
|
<state width="1877" height="421" key="GridCell.Tab.1.left" timestamp="1589624369020">
|
||||||
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
|
</state>
|
||||||
|
<state width="1877" height="421" key="GridCell.Tab.1.left/0.0.1920.1040@0.0.1920.1040" timestamp="1589624369020" />
|
||||||
|
<state width="1877" height="421" key="GridCell.Tab.1.right" timestamp="1589624369020">
|
||||||
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
|
</state>
|
||||||
|
<state width="1877" height="421" key="GridCell.Tab.1.right/0.0.1920.1040@0.0.1920.1040" timestamp="1589624369020" />
|
||||||
<state x="767" y="433" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1589538516704">
|
<state x="767" y="433" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1589538516704">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state x="767" y="433" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.1920.1040@0.0.1920.1040" timestamp="1589538516704" />
|
<state x="767" y="433" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.1920.1040@0.0.1920.1040" timestamp="1589538516704" />
|
||||||
<state x="623" y="225" width="672" height="678" key="search.everywhere.popup" timestamp="1589537470094">
|
<state x="623" y="225" width="672" height="678" key="search.everywhere.popup" timestamp="1589618568164">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state x="623" y="225" width="672" height="678" key="search.everywhere.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1589537470094" />
|
<state x="623" y="225" width="672" height="678" key="search.everywhere.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1589618568164" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -1,9 +1,12 @@
|
|||||||
package com.chantha.jdbc.controller
|
package com.chantha.jdbc.controller
|
||||||
|
|
||||||
import com.chantha.jdbc.jpa.model.Customer
|
import com.chantha.jdbc.jpa.model.Customer
|
||||||
|
import com.chantha.jdbc.jpa.model.Order
|
||||||
import com.chantha.jdbc.jpa.service.customer.CustomerService
|
import com.chantha.jdbc.jpa.service.customer.CustomerService
|
||||||
import org.apache.catalina.User
|
import com.chantha.jdbc.jpa.view.ViewsInvoice
|
||||||
|
import org.apache.tomcat.util.json.JSONParser
|
||||||
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.bind.annotation.GetMapping
|
import org.springframework.web.bind.annotation.GetMapping
|
||||||
import org.springframework.web.bind.annotation.RestController
|
import org.springframework.web.bind.annotation.RestController
|
||||||
|
|
||||||
|
@ -9,8 +9,5 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
@RestController
|
@RestController
|
||||||
class OrderController @Autowired constructor(private val orderService: OrderService) {
|
class OrderController @Autowired constructor(private val orderService: OrderService) {
|
||||||
|
|
||||||
@GetMapping("/")
|
|
||||||
fun findAllOrder():List<Order>{
|
|
||||||
return orderService.findAll().toList()
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.chantha.jdbc.controller
|
||||||
|
|
||||||
|
import com.chantha.jdbc.jpa.model.Product
|
||||||
|
import com.chantha.jdbc.jpa.model.view.ProductWithOrderDetail
|
||||||
|
import com.chantha.jdbc.jpa.repo.ProductRepo
|
||||||
|
import com.chantha.jdbc.jpa.service.product.ProductService
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping
|
||||||
|
import org.springframework.web.bind.annotation.RestController
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class ProductController @Autowired constructor(private val productService: ProductService) {
|
||||||
|
|
||||||
|
@GetMapping("/product")
|
||||||
|
fun product():List<ProductWithOrderDetail>{
|
||||||
|
return productService.fetchAllProducts()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,9 +1,6 @@
|
|||||||
package com.chantha.jdbc.jpa.model;
|
package com.chantha.jdbc.jpa.model;
|
||||||
|
|
||||||
import com.chantha.jdbc.jpa.view.Views;
|
|
||||||
import com.chantha.jdbc.utils.CustomGenderSerializer;
|
|
||||||
import com.fasterxml.jackson.annotation.*;
|
import com.fasterxml.jackson.annotation.*;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -11,6 +8,8 @@ import java.util.List;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "tbCustomer")
|
@Table(name = "tbCustomer")
|
||||||
|
@JsonPropertyOrder({"id","cusName","gender","orders"})
|
||||||
|
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
|
||||||
public class Customer implements Serializable {
|
public class Customer implements Serializable {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
@ -31,7 +31,7 @@ public class Order implements Serializable {
|
|||||||
@JoinColumn(name = "cusId",nullable = false,referencedColumnName = "id")
|
@JoinColumn(name = "cusId",nullable = false,referencedColumnName = "id")
|
||||||
private Customer customer;
|
private Customer customer;
|
||||||
|
|
||||||
@JsonManagedReference
|
|
||||||
@OneToMany(mappedBy = "order")
|
@OneToMany(mappedBy = "order")
|
||||||
private List<OrderDetail> orderDetails;
|
private List<OrderDetail> orderDetails;
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ public class Order implements Serializable {
|
|||||||
this.customer = customer;
|
this.customer = customer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonManagedReference
|
||||||
public List<OrderDetail> getOrderDetails() {
|
public List<OrderDetail> getOrderDetails() {
|
||||||
return orderDetails;
|
return orderDetails;
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,13 @@ package com.chantha.jdbc.jpa.model;
|
|||||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class OrderDetail {
|
public class OrderDetail implements Serializable {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long orderDetailId;
|
private Long orderDetailId;
|
||||||
@ -16,7 +18,8 @@ public class OrderDetail {
|
|||||||
|
|
||||||
private double price;
|
private double price;
|
||||||
|
|
||||||
@JsonManagedReference
|
|
||||||
|
@JsonBackReference
|
||||||
@ManyToOne(fetch = FetchType.EAGER)
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
@JoinColumn(name = "orderId",nullable = false)
|
@JoinColumn(name = "orderId",nullable = false)
|
||||||
private Order order;
|
private Order order;
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
package com.chantha.jdbc.jpa.model;
|
package com.chantha.jdbc.jpa.model;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
import com.fasterxml.jackson.annotation.*;
|
||||||
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class Product {
|
//@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "productId")
|
||||||
|
public class Product implements Serializable {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
@ -59,7 +60,8 @@ public class Product {
|
|||||||
this.orderDetails=orderDetails;
|
this.orderDetails=orderDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonManagedReference
|
// @JsonManagedReference
|
||||||
|
@JsonProperty("orderDetails")
|
||||||
@OneToMany(fetch = FetchType.EAGER,mappedBy = "product")
|
@OneToMany(fetch = FetchType.EAGER,mappedBy = "product")
|
||||||
private List<OrderDetail> orderDetails;
|
private List<OrderDetail> orderDetails;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.chantha.jdbc.jpa.model.view;
|
||||||
|
|
||||||
|
public class OrderDetailView {
|
||||||
|
public Long getOrderDetailId() {
|
||||||
|
return orderDetailId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderDetailId(Long orderDetailId) {
|
||||||
|
this.orderDetailId = orderDetailId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getQty() {
|
||||||
|
return qty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQty(int qty) {
|
||||||
|
this.qty = qty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getPrice() {
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrice(double price) {
|
||||||
|
this.price = price;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Long orderDetailId;
|
||||||
|
private int qty;
|
||||||
|
private double price;
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.chantha.jdbc.jpa.model.view;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ProductWithOrderDetail {
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
public Long getProductId() {
|
||||||
|
return productId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductId(Long productId) {
|
||||||
|
this.productId = productId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductName() {
|
||||||
|
return productName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductName(String productName) {
|
||||||
|
this.productName = productName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<OrderDetailView> getDetails() {
|
||||||
|
return details;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDetails(List<OrderDetailView> details) {
|
||||||
|
this.details = details;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String productName;
|
||||||
|
private List<OrderDetailView> details;
|
||||||
|
}
|
||||||
|
|
@ -1,15 +1,20 @@
|
|||||||
package com.chantha.jdbc.jpa.repo;
|
package com.chantha.jdbc.jpa.repo;
|
||||||
|
|
||||||
import com.chantha.jdbc.jpa.model.Customer;
|
import com.chantha.jdbc.jpa.model.Customer;
|
||||||
import com.chantha.jdbc.jpa.model.Order;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.data.repository.CrudRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
|
||||||
public interface CustomerRepo extends CrudRepository<Customer,Long> {
|
public interface CustomerRepo extends CrudRepository<Customer,Long> {
|
||||||
@Query(value = "SELECT *\n" +
|
@Query(value = "SELECT *\n" +
|
||||||
" FROM tb_order o\n" +
|
" FROM tb_order o\n" +
|
||||||
|
" INNER JOIN order_detail od\n" +
|
||||||
|
" ON (o.order_id=od.order_id)\n" +
|
||||||
" INNER JOIN tb_customer c\n" +
|
" INNER JOIN tb_customer c\n" +
|
||||||
"ON (o.cus_id=c.id)",nativeQuery = true)
|
" ON (o.cus_id=c.id)\n" +
|
||||||
|
" INNER JOIN product pro\n" +
|
||||||
|
" ON (pro.product_id=od.product_id)\n" +
|
||||||
|
"\n" +
|
||||||
|
"\t\t",nativeQuery = true)
|
||||||
@Override
|
@Override
|
||||||
Iterable<Customer> findAll();
|
Iterable<Customer> findAll();
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ import org.springframework.data.jpa.repository.Query;
|
|||||||
import org.springframework.data.repository.CrudRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface OrderRepo extends CrudRepository<Order,Long> {
|
public interface OrderRepo extends CrudRepository<Order,Long> {
|
||||||
@Query(value = "SELECT * \n" +
|
@Query(value = "SELECT * \n" +
|
||||||
|
13
src/main/kotlin/com/chantha/jdbc/jpa/repo/ProductRepo.kt
Normal file
13
src/main/kotlin/com/chantha/jdbc/jpa/repo/ProductRepo.kt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package com.chantha.jdbc.jpa.repo
|
||||||
|
|
||||||
|
import com.chantha.jdbc.jpa.model.Product
|
||||||
|
import org.springframework.data.jpa.repository.Query
|
||||||
|
import org.springframework.data.repository.CrudRepository
|
||||||
|
import org.springframework.stereotype.Repository
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
interface ProductRepo : CrudRepository<Product,Long>{
|
||||||
|
@Query("SELECT * FROM product INNER JOIN order_detail ON (product.product_id=order_detail.product_id)"
|
||||||
|
, nativeQuery = true)
|
||||||
|
override fun findAll(): MutableIterable<Product>
|
||||||
|
}
|
@ -3,6 +3,7 @@ package com.chantha.jdbc.jpa.service.order;
|
|||||||
import com.chantha.jdbc.jpa.model.Order;
|
import com.chantha.jdbc.jpa.model.Order;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@Service
|
@Service
|
||||||
public class OrderServiceImpl implements OrderService{
|
public class OrderServiceImpl implements OrderService{
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
package com.chantha.jdbc.jpa.service.product
|
||||||
|
|
||||||
|
import com.chantha.jdbc.jpa.model.view.ProductWithOrderDetail
|
||||||
|
import org.springframework.stereotype.Service
|
||||||
|
|
||||||
|
@Service
|
||||||
|
interface ProductService {
|
||||||
|
fun fetchAllProducts(): List<ProductWithOrderDetail>
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.chantha.jdbc.jpa.service.product
|
||||||
|
|
||||||
|
import com.chantha.jdbc.jpa.model.OrderDetail
|
||||||
|
import com.chantha.jdbc.jpa.model.Product
|
||||||
|
import com.chantha.jdbc.jpa.model.view.OrderDetailView
|
||||||
|
import com.chantha.jdbc.jpa.model.view.ProductWithOrderDetail
|
||||||
|
import com.chantha.jdbc.jpa.repo.ProductRepo
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
import org.springframework.stereotype.Service
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
@Service
|
||||||
|
class ProductServiceImpl @Autowired constructor(private val productRepo: ProductRepo) : ProductService {
|
||||||
|
|
||||||
|
override fun fetchAllProducts(): List<ProductWithOrderDetail> {
|
||||||
|
return productRepo.findAll().map { toView(it) }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun toView(data: Product): ProductWithOrderDetail {
|
||||||
|
val view = ProductWithOrderDetail()
|
||||||
|
view.productId = data.productId
|
||||||
|
view.productName = data.productName
|
||||||
|
view.details = data.orderDetails.map { toOrderDetailView(it) }
|
||||||
|
return view
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun toOrderDetailView(data: OrderDetail): OrderDetailView {
|
||||||
|
val view = OrderDetailView()
|
||||||
|
view.orderDetailId = data.orderDetailId
|
||||||
|
view.price = data.price
|
||||||
|
view.qty = data.qty
|
||||||
|
return view
|
||||||
|
}
|
||||||
|
}
|
18
src/main/kotlin/com/chantha/jdbc/jpa/view/Entity.kt
Normal file
18
src/main/kotlin/com/chantha/jdbc/jpa/view/Entity.kt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package com.chantha.jdbc.jpa.view
|
||||||
|
|
||||||
|
import com.chantha.jdbc.jpa.model.Customer
|
||||||
|
import com.chantha.jdbc.jpa.model.Gender
|
||||||
|
|
||||||
|
fun ViewsInvoice.toView():Customer{
|
||||||
|
return this.toView2()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ViewsInvoice.toView2(): Customer{
|
||||||
|
val data=Customer()
|
||||||
|
data.id=this.id
|
||||||
|
data.cusName=this.cusName
|
||||||
|
data.gender=this.gender
|
||||||
|
data.orders=this.order
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
@ -1,78 +0,0 @@
|
|||||||
package com.chantha.jdbc.jpa.view;
|
|
||||||
|
|
||||||
import com.chantha.jdbc.jpa.model.Gender;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class Views {
|
|
||||||
public static class Public{
|
|
||||||
private Long Id;
|
|
||||||
private String cusName;
|
|
||||||
private Gender gender;
|
|
||||||
private int orderId;
|
|
||||||
private double amount;
|
|
||||||
private Date orderDate;
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
Id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCusName() {
|
|
||||||
return cusName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCusName(String cusName) {
|
|
||||||
this.cusName = cusName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Gender getGender() {
|
|
||||||
return gender;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGender(Gender gender) {
|
|
||||||
this.gender = gender;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getOrderId() {
|
|
||||||
return orderId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrderId(int orderId) {
|
|
||||||
this.orderId = orderId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getAmount() {
|
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAmount(double amount) {
|
|
||||||
this.amount = amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getOrderDate() {
|
|
||||||
return orderDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrderDate(Date orderDate) {
|
|
||||||
this.orderDate = orderDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Public() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Public(Long id, String cusName, Gender gender, int orderId, double amount, Date orderDate) {
|
|
||||||
Id = id;
|
|
||||||
this.cusName = cusName;
|
|
||||||
this.gender = gender;
|
|
||||||
this.orderId = orderId;
|
|
||||||
this.amount = amount;
|
|
||||||
this.orderDate = orderDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
24
src/main/kotlin/com/chantha/jdbc/jpa/view/ViewsInvoice.kt
Normal file
24
src/main/kotlin/com/chantha/jdbc/jpa/view/ViewsInvoice.kt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package com.chantha.jdbc.jpa.view
|
||||||
|
|
||||||
|
import com.chantha.jdbc.jpa.model.Gender
|
||||||
|
import com.chantha.jdbc.jpa.model.Order
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
class ViewsInvoice {
|
||||||
|
|
||||||
|
var id: Long? = 0
|
||||||
|
|
||||||
|
var cusName: String? = null
|
||||||
|
|
||||||
|
var gender: Gender? = Gender.OTHER
|
||||||
|
|
||||||
|
var orderId: Int? = 0
|
||||||
|
|
||||||
|
var orderDate: Date? = Calendar.getInstance().time
|
||||||
|
|
||||||
|
var amount: Double? = 0.0
|
||||||
|
|
||||||
|
var order: List<Order> ? = listOf()
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
package com.chantha.jdbc.utils.constants
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/chantha/jdbc/jpa/repo/ProductRepo.class
Normal file
BIN
target/classes/com/chantha/jdbc/jpa/repo/ProductRepo.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/chantha/jdbc/jpa/view/EntityKt.class
Normal file
BIN
target/classes/com/chantha/jdbc/jpa/view/EntityKt.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/chantha/jdbc/jpa/view/ViewsInvoice.class
Normal file
BIN
target/classes/com/chantha/jdbc/jpa/view/ViewsInvoice.class
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user