diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index eac19f4..f2a6d9d 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,7 +1,34 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -11,7 +38,9 @@
@@ -21,7 +50,9 @@
-
+
+
+
@@ -33,13 +64,15 @@
+
-
+
+
@@ -64,7 +97,12 @@
1589523805860
-
+
+
+
+
+
+
@@ -76,53 +114,65 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
\ No newline at end of file
diff --git a/src/main/kotlin/com/chantha/jdbc/controller/CustomerController.kt b/src/main/kotlin/com/chantha/jdbc/controller/CustomerController.kt
index 26bc24b..db576c3 100644
--- a/src/main/kotlin/com/chantha/jdbc/controller/CustomerController.kt
+++ b/src/main/kotlin/com/chantha/jdbc/controller/CustomerController.kt
@@ -1,9 +1,12 @@
package com.chantha.jdbc.controller
import com.chantha.jdbc.jpa.model.Customer
+import com.chantha.jdbc.jpa.model.Order
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.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController
diff --git a/src/main/kotlin/com/chantha/jdbc/controller/OrderController.kt b/src/main/kotlin/com/chantha/jdbc/controller/OrderController.kt
index b0376d9..ea6aca0 100644
--- a/src/main/kotlin/com/chantha/jdbc/controller/OrderController.kt
+++ b/src/main/kotlin/com/chantha/jdbc/controller/OrderController.kt
@@ -9,8 +9,5 @@ import org.springframework.web.bind.annotation.RestController
@RestController
class OrderController @Autowired constructor(private val orderService: OrderService) {
- @GetMapping("/")
- fun findAllOrder():List{
- return orderService.findAll().toList()
- }
+
}
\ No newline at end of file
diff --git a/src/main/kotlin/com/chantha/jdbc/controller/ProductController.kt b/src/main/kotlin/com/chantha/jdbc/controller/ProductController.kt
new file mode 100644
index 0000000..172b0e0
--- /dev/null
+++ b/src/main/kotlin/com/chantha/jdbc/controller/ProductController.kt
@@ -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{
+ return productService.fetchAllProducts()
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/model/Customer.java b/src/main/kotlin/com/chantha/jdbc/jpa/model/Customer.java
index c5c57c4..68f3841 100644
--- a/src/main/kotlin/com/chantha/jdbc/jpa/model/Customer.java
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/model/Customer.java
@@ -1,9 +1,6 @@
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.databind.annotation.JsonSerialize;
import javax.persistence.*;
import java.io.Serializable;
@@ -11,6 +8,8 @@ import java.util.List;
@Entity
@Table(name = "tbCustomer")
+@JsonPropertyOrder({"id","cusName","gender","orders"})
+@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class Customer implements Serializable {
@Id
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/model/Order.java b/src/main/kotlin/com/chantha/jdbc/jpa/model/Order.java
index 36fc4f6..9a1ca4a 100644
--- a/src/main/kotlin/com/chantha/jdbc/jpa/model/Order.java
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/model/Order.java
@@ -31,7 +31,7 @@ public class Order implements Serializable {
@JoinColumn(name = "cusId",nullable = false,referencedColumnName = "id")
private Customer customer;
- @JsonManagedReference
+
@OneToMany(mappedBy = "order")
private List orderDetails;
@@ -68,7 +68,7 @@ public class Order implements Serializable {
this.customer = customer;
}
- @JsonIgnore
+ @JsonManagedReference
public List getOrderDetails() {
return orderDetails;
}
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/model/OrderDetail.java b/src/main/kotlin/com/chantha/jdbc/jpa/model/OrderDetail.java
index a694062..5dda7d3 100644
--- a/src/main/kotlin/com/chantha/jdbc/jpa/model/OrderDetail.java
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/model/OrderDetail.java
@@ -3,11 +3,13 @@ package com.chantha.jdbc.jpa.model;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.JsonProperty;
import javax.persistence.*;
+import java.io.Serializable;
@Entity
-public class OrderDetail {
+public class OrderDetail implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long orderDetailId;
@@ -16,7 +18,8 @@ public class OrderDetail {
private double price;
- @JsonManagedReference
+
+ @JsonBackReference
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "orderId",nullable = false)
private Order order;
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/model/Product.java b/src/main/kotlin/com/chantha/jdbc/jpa/model/Product.java
index 95f4cfc..aca6da2 100644
--- a/src/main/kotlin/com/chantha/jdbc/jpa/model/Product.java
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/model/Product.java
@@ -1,13 +1,14 @@
package com.chantha.jdbc.jpa.model;
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.*;
import javax.persistence.*;
+import java.io.Serializable;
import java.util.List;
@Entity
-public class Product {
+//@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "productId")
+public class Product implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -59,7 +60,8 @@ public class Product {
this.orderDetails=orderDetails;
}
- @JsonManagedReference
+// @JsonManagedReference
+ @JsonProperty("orderDetails")
@OneToMany(fetch = FetchType.EAGER,mappedBy = "product")
private List orderDetails;
}
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/model/view/OrderDetailView.java b/src/main/kotlin/com/chantha/jdbc/jpa/model/view/OrderDetailView.java
new file mode 100644
index 0000000..9475e0d
--- /dev/null
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/model/view/OrderDetailView.java
@@ -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;
+}
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/model/view/ProductWithOrderDetail.java b/src/main/kotlin/com/chantha/jdbc/jpa/model/view/ProductWithOrderDetail.java
new file mode 100644
index 0000000..dfc3363
--- /dev/null
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/model/view/ProductWithOrderDetail.java
@@ -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 getDetails() {
+ return details;
+ }
+
+ public void setDetails(List details) {
+ this.details = details;
+ }
+
+ private String productName;
+ private List details;
+}
+
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/repo/CustomerRepo.java b/src/main/kotlin/com/chantha/jdbc/jpa/repo/CustomerRepo.java
index cf1b6af..236acac 100644
--- a/src/main/kotlin/com/chantha/jdbc/jpa/repo/CustomerRepo.java
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/repo/CustomerRepo.java
@@ -1,15 +1,20 @@
package com.chantha.jdbc.jpa.repo;
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.repository.CrudRepository;
public interface CustomerRepo extends CrudRepository {
- @Query(value = "SELECT * \n" +
- "FROM tb_order o \n" +
- "INNER JOIN tb_customer c\n" +
- "ON (o.cus_id=c.id)",nativeQuery = true)
+ @Query(value = "SELECT *\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" +
+ " 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
Iterable findAll();
}
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/repo/OrderRepo.java b/src/main/kotlin/com/chantha/jdbc/jpa/repo/OrderRepo.java
index 8318e62..1e1bb47 100644
--- a/src/main/kotlin/com/chantha/jdbc/jpa/repo/OrderRepo.java
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/repo/OrderRepo.java
@@ -5,6 +5,8 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
+import java.util.List;
+
@Repository
public interface OrderRepo extends CrudRepository {
@Query(value = "SELECT * \n" +
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/repo/ProductRepo.kt b/src/main/kotlin/com/chantha/jdbc/jpa/repo/ProductRepo.kt
new file mode 100644
index 0000000..992c05f
--- /dev/null
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/repo/ProductRepo.kt
@@ -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{
+ @Query("SELECT * FROM product INNER JOIN order_detail ON (product.product_id=order_detail.product_id)"
+ , nativeQuery = true)
+ override fun findAll(): MutableIterable
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.java b/src/main/kotlin/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.java
index d1c145d..c58d247 100644
--- a/src/main/kotlin/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.java
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.java
@@ -3,6 +3,7 @@ package com.chantha.jdbc.jpa.service.order;
import com.chantha.jdbc.jpa.model.Order;
import org.springframework.stereotype.Service;
+import java.util.List;
import java.util.Optional;
@Service
public class OrderServiceImpl implements OrderService{
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/service/product/ProductService.kt b/src/main/kotlin/com/chantha/jdbc/jpa/service/product/ProductService.kt
new file mode 100644
index 0000000..75c3274
--- /dev/null
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/service/product/ProductService.kt
@@ -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
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/service/product/ProductServiceImpl.kt b/src/main/kotlin/com/chantha/jdbc/jpa/service/product/ProductServiceImpl.kt
new file mode 100644
index 0000000..e99b733
--- /dev/null
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/service/product/ProductServiceImpl.kt
@@ -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 {
+ 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
+ }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/view/Entity.kt b/src/main/kotlin/com/chantha/jdbc/jpa/view/Entity.kt
new file mode 100644
index 0000000..c3e13f7
--- /dev/null
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/view/Entity.kt
@@ -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
+}
+
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/view/Views.java b/src/main/kotlin/com/chantha/jdbc/jpa/view/Views.java
deleted file mode 100644
index 2d504bb..0000000
--- a/src/main/kotlin/com/chantha/jdbc/jpa/view/Views.java
+++ /dev/null
@@ -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;
- }
-
- }
-
-}
diff --git a/src/main/kotlin/com/chantha/jdbc/jpa/view/ViewsInvoice.kt b/src/main/kotlin/com/chantha/jdbc/jpa/view/ViewsInvoice.kt
new file mode 100644
index 0000000..9ce3717
--- /dev/null
+++ b/src/main/kotlin/com/chantha/jdbc/jpa/view/ViewsInvoice.kt
@@ -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 ? = listOf()
+
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/chantha/jdbc/utils/constants/Constants.kt b/src/main/kotlin/com/chantha/jdbc/utils/constants/Constants.kt
new file mode 100644
index 0000000..9113d2b
--- /dev/null
+++ b/src/main/kotlin/com/chantha/jdbc/utils/constants/Constants.kt
@@ -0,0 +1,2 @@
+package com.chantha.jdbc.utils.constants
+
diff --git a/target/classes/META-INF/jdbc.kotlin_module b/target/classes/META-INF/jdbc.kotlin_module
index 924142d..4c9292b 100644
Binary files a/target/classes/META-INF/jdbc.kotlin_module and b/target/classes/META-INF/jdbc.kotlin_module differ
diff --git a/target/classes/com/chantha/jdbc/controller/CustomerController.class b/target/classes/com/chantha/jdbc/controller/CustomerController.class
index 57b7d47..029bd26 100644
Binary files a/target/classes/com/chantha/jdbc/controller/CustomerController.class and b/target/classes/com/chantha/jdbc/controller/CustomerController.class differ
diff --git a/target/classes/com/chantha/jdbc/controller/OrderController.class b/target/classes/com/chantha/jdbc/controller/OrderController.class
index 605690f..eddcde5 100644
Binary files a/target/classes/com/chantha/jdbc/controller/OrderController.class and b/target/classes/com/chantha/jdbc/controller/OrderController.class differ
diff --git a/target/classes/com/chantha/jdbc/controller/ProductController.class b/target/classes/com/chantha/jdbc/controller/ProductController.class
new file mode 100644
index 0000000..fa675b3
Binary files /dev/null and b/target/classes/com/chantha/jdbc/controller/ProductController.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/model/Customer$GENDER.class b/target/classes/com/chantha/jdbc/jpa/model/Customer$GENDER.class
index d628435..0048980 100644
Binary files a/target/classes/com/chantha/jdbc/jpa/model/Customer$GENDER.class and b/target/classes/com/chantha/jdbc/jpa/model/Customer$GENDER.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/model/Customer.class b/target/classes/com/chantha/jdbc/jpa/model/Customer.class
index 7a32d62..0961ce3 100644
Binary files a/target/classes/com/chantha/jdbc/jpa/model/Customer.class and b/target/classes/com/chantha/jdbc/jpa/model/Customer.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/model/Order.class b/target/classes/com/chantha/jdbc/jpa/model/Order.class
index ecf8ef8..be4a4c8 100644
Binary files a/target/classes/com/chantha/jdbc/jpa/model/Order.class and b/target/classes/com/chantha/jdbc/jpa/model/Order.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/model/OrderDetail.class b/target/classes/com/chantha/jdbc/jpa/model/OrderDetail.class
index 1eb3393..9e170a8 100644
Binary files a/target/classes/com/chantha/jdbc/jpa/model/OrderDetail.class and b/target/classes/com/chantha/jdbc/jpa/model/OrderDetail.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/model/Product.class b/target/classes/com/chantha/jdbc/jpa/model/Product.class
index b557d2f..3cb7783 100644
Binary files a/target/classes/com/chantha/jdbc/jpa/model/Product.class and b/target/classes/com/chantha/jdbc/jpa/model/Product.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/model/view/OrderDetailView.class b/target/classes/com/chantha/jdbc/jpa/model/view/OrderDetailView.class
new file mode 100644
index 0000000..714417c
Binary files /dev/null and b/target/classes/com/chantha/jdbc/jpa/model/view/OrderDetailView.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/model/view/ProductWithOrderDetail.class b/target/classes/com/chantha/jdbc/jpa/model/view/ProductWithOrderDetail.class
new file mode 100644
index 0000000..a60d1ae
Binary files /dev/null and b/target/classes/com/chantha/jdbc/jpa/model/view/ProductWithOrderDetail.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/repo/CustomerRepo.class b/target/classes/com/chantha/jdbc/jpa/repo/CustomerRepo.class
index 2286181..b3a60a7 100644
Binary files a/target/classes/com/chantha/jdbc/jpa/repo/CustomerRepo.class and b/target/classes/com/chantha/jdbc/jpa/repo/CustomerRepo.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/repo/ProductRepo.class b/target/classes/com/chantha/jdbc/jpa/repo/ProductRepo.class
new file mode 100644
index 0000000..5f6934c
Binary files /dev/null and b/target/classes/com/chantha/jdbc/jpa/repo/ProductRepo.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.class b/target/classes/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.class
index ca4d932..938359d 100644
Binary files a/target/classes/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.class and b/target/classes/com/chantha/jdbc/jpa/service/order/OrderServiceImpl.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/service/product/ProductService.class b/target/classes/com/chantha/jdbc/jpa/service/product/ProductService.class
new file mode 100644
index 0000000..16169fa
Binary files /dev/null and b/target/classes/com/chantha/jdbc/jpa/service/product/ProductService.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/service/product/ProductServiceImpl.class b/target/classes/com/chantha/jdbc/jpa/service/product/ProductServiceImpl.class
new file mode 100644
index 0000000..2f70426
Binary files /dev/null and b/target/classes/com/chantha/jdbc/jpa/service/product/ProductServiceImpl.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/view/EntityKt.class b/target/classes/com/chantha/jdbc/jpa/view/EntityKt.class
new file mode 100644
index 0000000..bd55d41
Binary files /dev/null and b/target/classes/com/chantha/jdbc/jpa/view/EntityKt.class differ
diff --git a/target/classes/com/chantha/jdbc/jpa/view/Views$Public.class b/target/classes/com/chantha/jdbc/jpa/view/Views$Public.class
deleted file mode 100644
index de961d4..0000000
Binary files a/target/classes/com/chantha/jdbc/jpa/view/Views$Public.class and /dev/null differ
diff --git a/target/classes/com/chantha/jdbc/jpa/view/Views.class b/target/classes/com/chantha/jdbc/jpa/view/Views.class
deleted file mode 100644
index 4b6daf3..0000000
Binary files a/target/classes/com/chantha/jdbc/jpa/view/Views.class and /dev/null differ
diff --git a/target/classes/com/chantha/jdbc/jpa/view/ViewsInvoice.class b/target/classes/com/chantha/jdbc/jpa/view/ViewsInvoice.class
new file mode 100644
index 0000000..9c6c1d3
Binary files /dev/null and b/target/classes/com/chantha/jdbc/jpa/view/ViewsInvoice.class differ