diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 00000000..993c92af
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 00000000..63e90019
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 00000000..712ab9d9
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 00000000..5ddb3b31
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 00000000..35eb1ddf
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/10SuperMarketServlet/WebContent/META-INF/MANIFEST.MF b/10SuperMarketServlet/WebContent/META-INF/MANIFEST.MF
deleted file mode 100644
index 254272e1..00000000
--- a/10SuperMarketServlet/WebContent/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
diff --git a/10SuperMarketServlet/WebContent/WEB-INF/error.jsp b/10SuperMarketServlet/WebContent/WEB-INF/error.jsp
deleted file mode 100644
index 23bd3052..00000000
--- a/10SuperMarketServlet/WebContent/WEB-INF/error.jsp
+++ /dev/null
@@ -1,14 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1" isErrorPage="true" %>
-
-
-
-
-Insert title here
-
-
-Sorry an exception occured!
-
-Exception is: <%= exception %>
-
-
\ No newline at end of file
diff --git a/10SuperMarketServlet/WebContent/WEB-INF/web.xml b/10SuperMarketServlet/WebContent/WEB-INF/web.xml
deleted file mode 100644
index 34f5873f..00000000
--- a/10SuperMarketServlet/WebContent/WEB-INF/web.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
- GroceryServlet2
-
-
-
- index1.html
-
-
- java.lang.Exception
- /error.jsp
-
-
-
- DemoServlet
- MainServlet.DemoServlet
-
-
-
- DemoServlet
- /home1
-
-
-
-
- DemoServlet2
- MainServlet.DemoServlet2
-
-
-
-
- DemoServlet2
- /viewgoods
-
-
-
-
- DemoServlet3
- MainServlet.DemoServlet3
-
-
-
-
- DemoServlet3
- /viewsupplier
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/10SuperMarketServlet/WebContent/home1.jsp b/10SuperMarketServlet/WebContent/home1.jsp
deleted file mode 100644
index 0eba4b98..00000000
--- a/10SuperMarketServlet/WebContent/home1.jsp
+++ /dev/null
@@ -1,44 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
-<%@page import="java.util.ArrayList"%>
-<%@page import="java.util.List"%>
-<%@page import="model.Customer"%>
-
-
-
- <%
- List customerList = (ArrayList) request.getAttribute("list");
-
- for (Customer ref : customerList) {
- out.print("Id: " + ref.getCustomerId());
- out.print("
");
- out.print("Name: " + ref.getCustomerName());
- out.print("
");
- out.print("Address: " + ref.getCustomerAddress());
- out.print("
");
- out.print("PaymentMode: " + ref.getPaymentMode());
- out.print("
");
- }
- %>
-
-
- <%
- Integer hitsCount = (Integer)application.getAttribute("hitCounter");
- if( hitsCount ==null || hitsCount == 0 ) {
- /* First visit */
- out.println("Welcome to my website!");
- hitsCount = 1;
- } else {
- /* return visit */
- out.println("Welcome back to my website!");
- hitsCount += 1;
- }
- application.setAttribute("hitCounter", hitsCount);
- %>
-
- Total number of visits: <%= hitsCount%>
-
-
-
-
\ No newline at end of file
diff --git a/10SuperMarketServlet/WebContent/index1.html b/10SuperMarketServlet/WebContent/index1.html
deleted file mode 100644
index 49dec3f4..00000000
--- a/10SuperMarketServlet/WebContent/index1.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/10SuperMarketServlet/WebContent/viewgoods.jsp b/10SuperMarketServlet/WebContent/viewgoods.jsp
deleted file mode 100644
index aecbbd38..00000000
--- a/10SuperMarketServlet/WebContent/viewgoods.jsp
+++ /dev/null
@@ -1,30 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
-<%@page import="java.util.ArrayList"%>
-<%@page import="java.util.List"%>
-<%@page import="model.Goods"%>
-
-
-
-goods
-
-
-
- <%
- List goodsList = (ArrayList) request.getAttribute("glist");
-
- for (Goods ref : goodsList) {
- out.print("Id: " + ref.getGoodsId());
- out.print("
");
- out.print("Name: " + ref.getGoodsName());
- out.print("
");
- out.print("Price: " + ref.getGoodsPrice());
- out.print("
");
- out.print("GoodsQuantity: " + ref.getGoodsQuantity());
- out.print("
");
-
- }
- %>
-
-
\ No newline at end of file
diff --git a/10SuperMarketServlet/WebContent/viewsupplier.jsp b/10SuperMarketServlet/WebContent/viewsupplier.jsp
deleted file mode 100644
index 267bc090..00000000
--- a/10SuperMarketServlet/WebContent/viewsupplier.jsp
+++ /dev/null
@@ -1,34 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
-<%@page import="java.util.ArrayList"%>
-<%@page import="java.util.List"%>
-<%@page import="model.Supplier"%>
-
-
-
-goods
-
-
-
- <%
- List supplierList = (ArrayList) request.getAttribute("slist");
-
- for (Supplier ref : supplierList) {
- out.print("Id: " + ref.getSupplierId());
- out.print("
");
- out.print("Name: " + ref.getSupplierName());
- out.print("
");
- out.print("Price: " + ref.getSupplierAddress());
- out.print("
");
- out.print("OrderQuantity: " + ref.getQuantityOrder());
- out.print("
");
- out.print("OrderId: " + ref.getOrderId());
- out.print("
");
- out.print("Amount: " + ref.getAmount());
- out.print("
");
-
- }
- %>
-
-
\ No newline at end of file
diff --git a/10SuperMarketServlet/build/classes/controller/DemoServlet.class b/10SuperMarketServlet/build/classes/controller/DemoServlet.class
deleted file mode 100644
index 87c5d25b..00000000
Binary files a/10SuperMarketServlet/build/classes/controller/DemoServlet.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/controller/GroceryAnnotation.class b/10SuperMarketServlet/build/classes/controller/GroceryAnnotation.class
deleted file mode 100644
index d90de477..00000000
Binary files a/10SuperMarketServlet/build/classes/controller/GroceryAnnotation.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/model/Customer.class b/10SuperMarketServlet/build/classes/model/Customer.class
deleted file mode 100644
index d0f396cb..00000000
Binary files a/10SuperMarketServlet/build/classes/model/Customer.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/model/Goods.class b/10SuperMarketServlet/build/classes/model/Goods.class
deleted file mode 100644
index 4699f171..00000000
Binary files a/10SuperMarketServlet/build/classes/model/Goods.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/model/Retailer.class b/10SuperMarketServlet/build/classes/model/Retailer.class
deleted file mode 100644
index bce0f3d6..00000000
Binary files a/10SuperMarketServlet/build/classes/model/Retailer.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/model/Supplier.class b/10SuperMarketServlet/build/classes/model/Supplier.class
deleted file mode 100644
index 7a7e46cf..00000000
Binary files a/10SuperMarketServlet/build/classes/model/Supplier.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/repository/CustomerDAO.class b/10SuperMarketServlet/build/classes/repository/CustomerDAO.class
deleted file mode 100644
index a7a24f26..00000000
Binary files a/10SuperMarketServlet/build/classes/repository/CustomerDAO.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/repository/CustomerDAOImpl.class b/10SuperMarketServlet/build/classes/repository/CustomerDAOImpl.class
deleted file mode 100644
index 32b96e0f..00000000
Binary files a/10SuperMarketServlet/build/classes/repository/CustomerDAOImpl.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/repository/GoodsDAO.class b/10SuperMarketServlet/build/classes/repository/GoodsDAO.class
deleted file mode 100644
index b633d3e2..00000000
Binary files a/10SuperMarketServlet/build/classes/repository/GoodsDAO.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/repository/GoodsDAOImpl.class b/10SuperMarketServlet/build/classes/repository/GoodsDAOImpl.class
deleted file mode 100644
index 11fabf49..00000000
Binary files a/10SuperMarketServlet/build/classes/repository/GoodsDAOImpl.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/repository/RetailerDAO.class b/10SuperMarketServlet/build/classes/repository/RetailerDAO.class
deleted file mode 100644
index 106f92ab..00000000
Binary files a/10SuperMarketServlet/build/classes/repository/RetailerDAO.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/repository/RetailerDAOImpl.class b/10SuperMarketServlet/build/classes/repository/RetailerDAOImpl.class
deleted file mode 100644
index 99c539bd..00000000
Binary files a/10SuperMarketServlet/build/classes/repository/RetailerDAOImpl.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/repository/SupplierDAO.class b/10SuperMarketServlet/build/classes/repository/SupplierDAO.class
deleted file mode 100644
index a577df65..00000000
Binary files a/10SuperMarketServlet/build/classes/repository/SupplierDAO.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/repository/SupplierDAOImpl.class b/10SuperMarketServlet/build/classes/repository/SupplierDAOImpl.class
deleted file mode 100644
index edb0705c..00000000
Binary files a/10SuperMarketServlet/build/classes/repository/SupplierDAOImpl.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/service/CustomerService.class b/10SuperMarketServlet/build/classes/service/CustomerService.class
deleted file mode 100644
index 62f02692..00000000
Binary files a/10SuperMarketServlet/build/classes/service/CustomerService.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/service/CustomerServiceImpl.class b/10SuperMarketServlet/build/classes/service/CustomerServiceImpl.class
deleted file mode 100644
index 98b77d76..00000000
Binary files a/10SuperMarketServlet/build/classes/service/CustomerServiceImpl.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/service/GoodsService.class b/10SuperMarketServlet/build/classes/service/GoodsService.class
deleted file mode 100644
index 1c3f019e..00000000
Binary files a/10SuperMarketServlet/build/classes/service/GoodsService.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/service/GoodsServiceImpl.class b/10SuperMarketServlet/build/classes/service/GoodsServiceImpl.class
deleted file mode 100644
index cabaed6c..00000000
Binary files a/10SuperMarketServlet/build/classes/service/GoodsServiceImpl.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/service/RetailerService.class b/10SuperMarketServlet/build/classes/service/RetailerService.class
deleted file mode 100644
index c160c7ad..00000000
Binary files a/10SuperMarketServlet/build/classes/service/RetailerService.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/service/RetailerServiceImpl.class b/10SuperMarketServlet/build/classes/service/RetailerServiceImpl.class
deleted file mode 100644
index 413408bc..00000000
Binary files a/10SuperMarketServlet/build/classes/service/RetailerServiceImpl.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/service/SupplierService.class b/10SuperMarketServlet/build/classes/service/SupplierService.class
deleted file mode 100644
index 68dd431c..00000000
Binary files a/10SuperMarketServlet/build/classes/service/SupplierService.class and /dev/null differ
diff --git a/10SuperMarketServlet/build/classes/service/SupplierServiceImpl.class b/10SuperMarketServlet/build/classes/service/SupplierServiceImpl.class
deleted file mode 100644
index dd408fcf..00000000
Binary files a/10SuperMarketServlet/build/classes/service/SupplierServiceImpl.class and /dev/null differ
diff --git a/10SuperMarketServlet/pom.xml b/10SuperMarketServlet/pom.xml
deleted file mode 100644
index 0233ba81..00000000
--- a/10SuperMarketServlet/pom.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-
- 4.0.0
- GroceryServlet2
- GroceryServlet2
- 0.0.1-SNAPSHOT
- war
- Grocery
-
- src
-
-
- maven-compiler-plugin
- 3.7.0
-
- 1.8
- 1.8
-
-
-
- maven-war-plugin
- 3.0.0
-
- WebContent
-
-
-
-
-
-
- javax.servlet
- servlet-api
- 2.5
- provided
-
-
-
- org.springframework
- spring-context
- 5.0.5.RELEASE
-
-
-
- jstl
- jstl
- 1.2
-
-
- mysql
- mysql-connector-java
- 5.1.38
-
-
-
- org.springframework
- spring-jdbc
- 5.0.5.RELEASE
-
-
-
- org.springframework
- spring-context
- 5.0.5.RELEASE
-
-
-
- org.springframework
- spring-tx
- 5.0.5.RELEASE
-
-
-
- junit
- junit
- 4.11
- test
-
-
-
\ No newline at end of file
diff --git a/10SuperMarketServlet/src/MainServlet/DemoServlet.java b/10SuperMarketServlet/src/MainServlet/DemoServlet.java
deleted file mode 100644
index 1055e76d..00000000
--- a/10SuperMarketServlet/src/MainServlet/DemoServlet.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package MainServlet;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-
-import controller.AppJavaConfig;
-import model.Customer;
-import model.Goods;
-import service.CustomerService;
-import service.CustomerServiceImpl;
-import service.RetailerService;
-import service.RetailerServiceImpl;
-
-/**
- * Servlet implementation class DemoServlet
- */
-
-// @WebServlet("/ramServlet")
-public class DemoServlet extends HttpServlet {
-
- /**
- * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
- * response)
- */
-
- protected void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
-
- response.setContentType("text/html");
- ApplicationContext context = new AnnotationConfigApplicationContext(AppJavaConfig.class);
- //CustomerService customerService = (CustomerService) context.getBean("customerService",CustomerServiceImpl.class);
- RetailerService retailerService = (RetailerService) context.getBean("retailerService",
- RetailerServiceImpl.class);
-
-
- String ID = request.getParameter("id");
- int id = Integer.parseInt(ID);
-
-
-
-
- List customerList = retailerService.viewCustomer(id);
- //List goodsList = retailerService.viewGoods();
-
-
-
- // request.setAttribute("glist", goodsList);
- request.setAttribute("list", customerList);
-
- RequestDispatcher requestDispatcher = request.getRequestDispatcher("home1.jsp");
- // RequestDispatcher requestDispatchergoods = request.getRequestDispatcher("viewgoods.jsp");
- requestDispatcher.forward(request, response);
- //requestDispatchergoods.forward(request, response);
- }
-
-}
diff --git a/10SuperMarketServlet/src/MainServlet/DemoServlet2.java b/10SuperMarketServlet/src/MainServlet/DemoServlet2.java
deleted file mode 100644
index 8d1b4e97..00000000
--- a/10SuperMarketServlet/src/MainServlet/DemoServlet2.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package MainServlet;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-
-import controller.AppJavaConfig;
-import model.Customer;
-import model.Goods;
-import service.CustomerService;
-import service.CustomerServiceImpl;
-import service.RetailerService;
-import service.RetailerServiceImpl;
-
-/**
- * Servlet implementation class DemoServlet
- */
-
-// @WebServlet("/ramServlet")
-public class DemoServlet2 extends HttpServlet {
-
- /**
- * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
- * response)
- */
-
- protected void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
-
- response.setContentType("text/html");
- ApplicationContext context = new AnnotationConfigApplicationContext(AppJavaConfig.class);
- //CustomerService customerService = (CustomerService) context.getBean("customerService",CustomerServiceImpl.class);
- RetailerService retailerService = (RetailerService) context.getBean("retailerService",
- RetailerServiceImpl.class);
- // List customerList = retailerService.viewCustomer(106);
- List goodsList = retailerService.viewGoods();
-
-
-
- request.setAttribute("glist", goodsList);
- // request.setAttribute("list", customerList);
-
- // RequestDispatcher requestDispatcher = request.getRequestDispatcher("home1.jsp");
- RequestDispatcher requestDispatchergoods = request.getRequestDispatcher("viewgoods.jsp");
- //requestDispatcher.forward(request, response);
- requestDispatchergoods.forward(request, response);
- }
-
-}
diff --git a/10SuperMarketServlet/src/MainServlet/DemoServlet3.java b/10SuperMarketServlet/src/MainServlet/DemoServlet3.java
deleted file mode 100644
index ec8ecce7..00000000
--- a/10SuperMarketServlet/src/MainServlet/DemoServlet3.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package MainServlet;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-
-import controller.AppJavaConfig;
-import model.Customer;
-import model.Goods;
-import model.Supplier;
-import service.CustomerService;
-import service.CustomerServiceImpl;
-import service.RetailerService;
-import service.RetailerServiceImpl;
-
-/**
- * Servlet implementation class DemoServlet
- */
-
-// @WebServlet("/ramServlet")
-public class DemoServlet3 extends HttpServlet {
-
- /**
- * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
- * response)
- */
-
- protected void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
-
- response.setContentType("text/html");
- ApplicationContext context = new AnnotationConfigApplicationContext(AppJavaConfig.class);
- //CustomerService customerService = (CustomerService) context.getBean("customerService",CustomerServiceImpl.class);
- RetailerService retailerService = (RetailerService) context.getBean("retailerService",
- RetailerServiceImpl.class);
-
-
- String ID = request.getParameter("id1");
- try {
- int id1 = Integer.parseInt(ID);
-
-
-
-
- // List customerList = retailerService.viewCustomer(106);
-
- List supplierList = retailerService.viewSupplier(id1);
-
-
-
-
- request.setAttribute("slist", supplierList);
- // request.setAttribute("list", customerList);
-
- // RequestDispatcher requestDispatcher = request.getRequestDispatcher("home1.jsp");
- RequestDispatcher requestDispatcherSupplier = request.getRequestDispatcher("viewsupplier.jsp");
- //requestDispatcher.forward(request, response);
- requestDispatcherSupplier.forward(request, response);
- }catch (NumberFormatException e){
- System.out.println("not a number");
- }
- }
-
-}
diff --git a/10SuperMarketServlet/src/controller/AppJavaConfig.java b/10SuperMarketServlet/src/controller/AppJavaConfig.java
deleted file mode 100644
index 6aca2c56..00000000
--- a/10SuperMarketServlet/src/controller/AppJavaConfig.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package controller;
-
-import javax.sql.DataSource;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.core.env.Environment;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.datasource.DriverManagerDataSource;
-
-/**
- * @class this is java configuration file
- */
-@Configuration
-@ComponentScan({ "service", "repository", "controller" })
-@PropertySource(value = { "classpath:database.properties" })
-public class AppJavaConfig {
-
- @Autowired
- Environment environment;
-
- @Bean
- DataSource dataSource() {
- final DriverManagerDataSource driverManagerDataSource = new DriverManagerDataSource();
- driverManagerDataSource.setUrl(environment.getProperty("url"));
- driverManagerDataSource.setUsername(environment.getProperty("dbuser"));
- driverManagerDataSource.setPassword(environment.getProperty("dbpassword"));
- driverManagerDataSource.setDriverClassName(environment.getProperty("driver"));
- return driverManagerDataSource;
- }
-
- @Bean
- JdbcTemplate jdbcTempalte(DataSource dataSource) {
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- return jdbcTemplate;
- }
-
-
- /*
- * @Bean public CustomerDAO customerDaoBean() { return new CustomerDAOImpl(); }
- *
- * @Bean public GoodsDAO goodsDAOBean() { return new GoodsDAOImpl(); }
- *
- * @Bean public SupplierDAO supplierDAOBean() { return new SupplierDAOImpl(); }
- */
-
- /**
- * this is CustomerService bean used to invoke the services
- */
- /*
- * @Bean public RetailerDAO retailerDAOBean() { return new RetailerDAOImpl(); }
- *
- *//**
- * this is CustomerService bean used to invoke the services
- *//*
- * @Bean public CustomerService customerService() { return new
- * CustomerServiceImpl(); }
- */
-
- /**
- * this is GoodsService bean used to invoke the services
- */
- /*
- * @Bean public GoodsService goodsService() { return new GoodsServiceImpl(); }
- *
- * @Bean public SupplierService supplierService() { return new
- * SupplierServiceImpl(); }
- *
- * @Bean public RetailerService retailerService() { return new
- * RetailerServiceImpl(); }
- */
-
-}
diff --git a/10SuperMarketServlet/src/main/resources/database.properties b/10SuperMarketServlet/src/main/resources/database.properties
deleted file mode 100644
index 9c1f900e..00000000
--- a/10SuperMarketServlet/src/main/resources/database.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-driver=com.mysql.jdbc.Driver
-url=jdbc:mysql://localhost:3306/mydb1
-dbuser=root
-dbpassword=root
\ No newline at end of file
diff --git a/10SuperMarketServlet/src/model/Customer.java b/10SuperMarketServlet/src/model/Customer.java
deleted file mode 100644
index 86ec6b13..00000000
--- a/10SuperMarketServlet/src/model/Customer.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package model;
-
-/**
- * @author Ram
- *
- */
-
-
-
-
-/**
- * @class this class represent a customer entity
- *
- */
-public class Customer {
-
- /**
- * @field this is use to provide particular id which will represent a whole
- * record in table
- */
- private int customerId;
-
- /**
- * @field this is use to provide particular id which will represent a whole
- * record in table
- */
- private String customerName;
- /**
- * @field this is use to represent a name of the customer
- *
- */
- private String customerAddress;
- /**
- * @field this is use to represent a payment of the customer
- *
- */
- private String paymentMode;
-
- /**
- * @param customerId
- * @param customerName
- * @param customerAddress
- * @param paymentMode
- */
- public Customer(final int customerId, final String customerName, final String customerAddress,
- final String paymentMode) {
- this.customerId = customerId;
- this.customerName = customerName;
- this.customerAddress = customerAddress;
- this.paymentMode = paymentMode;
- }
-
- /**
- *
- * @param customerName
- *
- */
- public Customer(final String customerName) {
-
- this.customerName = customerName;
-
- }
-
- /**
- *
- * @constructor this is default constructor
- *
- */
- public Customer() {
-
- }
-
- /**
- * @return the customerId
- */
- public int getCustomerId() {
- return customerId;
- }
-
- /**
- * @param customerId
- * the customerId to set
- */
- public void setCustomerId(final int customerId) {
- this.customerId = customerId;
- }
-
- /**
- * @return the customerName
- */
- public String getCustomerName() {
- return customerName;
- }
-
- /**
- * @param customerName
- * the customerName to set
- */
- public void setCustomerName(final String customerName) {
- this.customerName = customerName;
- }
-
- /**
- * @return the customerAddress
- */
- public String getCustomerAddress() {
- return customerAddress;
- }
-
- /**
- * @param customerAddress
- * the customerAddress to set
- */
- public void setCustomerAddress(final String customerAddress) {
- this.customerAddress = customerAddress;
- }
-
- /**
- * @return the paymentMode
- */
- public String getPaymentMode() {
- return paymentMode;
- }
-
- /**
- * @param paymentMode
- * the paymentMode to set
- */
- public void setPaymentMode(final String paymentMode) {
- this.paymentMode = paymentMode;
- }
-
-}
diff --git a/10SuperMarketServlet/src/model/Goods.java b/10SuperMarketServlet/src/model/Goods.java
deleted file mode 100644
index 8a0ffeb1..00000000
--- a/10SuperMarketServlet/src/model/Goods.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package model;
-
-public class Goods {
-
-
- private int goodsId;
- private String goodsName;
- private int goodsQuantity;
- private double goodsPrice;
-
- /**
- * @param goodsId
- * @param goodsName
- * @param goodsQuantity
- * @param goodsPrice
- */
- public Goods(final int goodsId, final String goodsName, final int goodsQuantity,
- final double goodsPrice) {
- this.goodsId = goodsId;
- this.goodsName = goodsName;
- this.goodsQuantity = goodsQuantity;
- this.goodsPrice = goodsPrice;
- }
-
- public Goods() {
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @return the goodsId
- */
- public int getGoodsId() {
- return goodsId;
- }
-
- /**
- * @param goodsId
- * the goodsId to set
- */
- public void setGoodsId(int goodsId) {
- this.goodsId = goodsId;
- }
-
- /**
- * @return the goodsName
- */
- public String getGoodsName() {
- return goodsName;
- }
-
- /**
- * @param goodsName
- * the goodsName to set
- */
- public void setGoodsName(String goodsName) {
- this.goodsName = goodsName;
- }
-
- /**
- * @return the goodsQuantity
- */
- public int getGoodsQuantity() {
- return goodsQuantity;
- }
-
- /**
- * @param goodsQuantity
- * the goodsQuantity to set
- */
- public void setGoodsQuantity(int goodsQuantity) {
- this.goodsQuantity = goodsQuantity;
- }
-
- /**
- * @return the goodsPrice
- */
- public double getGoodsPrice() {
- return goodsPrice;
- }
-
- /**
- * @param goodsPrice
- * the goodsPrice to set
- */
- public void setGoodsPrice(double goodsPrice) {
- this.goodsPrice = goodsPrice;
- }
-
-}
diff --git a/10SuperMarketServlet/src/model/Retailer.java b/10SuperMarketServlet/src/model/Retailer.java
deleted file mode 100644
index db73d143..00000000
--- a/10SuperMarketServlet/src/model/Retailer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-
-package model;
-
-/**
- * @author Ram
- *
- */
-public class Retailer {
-
- private String retailerName;
- private String retailerAddres;
- /**
- * @param retailerName
- * @param retailerAddres
- */
-
- public Retailer ()
- {
-
- }
-
-
- public Retailer(String retailerName, String retailerAddres) {
- this.retailerName = retailerName;
- this.retailerAddres = retailerAddres;
- }
-
- /**
- * @return the retailerName
- */
- public String getRetailerName() {
- return retailerName;
- }
-
- /**
- * @param retailerName
- * the retailerName to set
- */
- public void setRetailerName(String retailerName) {
- this.retailerName = retailerName;
- }
-
- /**
- * @return the retailerAddres
- */
- public String getRetailerAddres() {
- return retailerAddres;
- }
-
- /**
- * @param retailerAddres
- * the retailerAddres to set
- */
- public void setRetailerAddres(String retailerAddres) {
- this.retailerAddres = retailerAddres;
- }
-
-
-
-
-
-
-
-
-
-
-
-}
diff --git a/10SuperMarketServlet/src/model/Supplier.java b/10SuperMarketServlet/src/model/Supplier.java
deleted file mode 100644
index 00ffc730..00000000
--- a/10SuperMarketServlet/src/model/Supplier.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package model;
-
-import java.util.List;
-
-/**
- * @author Sumit
- *
- */
-public class Supplier {
-
- private int supplierId;
- private String supplierName;
- private String supplierAddress;
- private int quantityOrder;
- private int orderId;
- private double amount;
- List goodsList;
-
- /**
- * @param supplierId
- * @param supplierName
- * @param supplierAddress
- * @param quantityOrder
- * @param orderId
- * @param amount
- * @param goodsList
- */
- public Supplier(int supplierId, String supplierName,
- String supplierAddress, int quantityOrder, int orderId,
- double amount, List goodsList) {
- this.supplierId = supplierId;
- this.supplierName = supplierName;
- this.supplierAddress = supplierAddress;
- this.quantityOrder = quantityOrder;
- this.orderId = orderId;
- this.amount = amount;
- this.goodsList = goodsList;
- }
-
- public Supplier() {
- // TODO Auto-generated constructor stub
- }
-
- public Supplier(int supplierId, String supplierName,
- String supplierAddress, int quantityOrder, int orderId,
- double amount) {
- this.supplierId = supplierId;
- this.supplierName = supplierName;
- this.supplierAddress = supplierAddress;
- this.quantityOrder = quantityOrder;
- this.orderId = orderId;
- this.amount = amount;
- }
-
- /**
- * @return the supplierId
- */
- public int getSupplierId() {
- return supplierId;
- }
-
- /**
- * @param supplierId
- * the supplierId to set
- */
- public void setSupplierId(int supplierId) {
- this.supplierId = supplierId;
- }
-
- /**
- * @return the supplierName
- */
- public String getSupplierName() {
- return supplierName;
- }
-
- /**
- * @param supplierName
- * the supplierName to set
- */
- public void setSupplierName(String supplierName) {
- this.supplierName = supplierName;
- }
-
- /**
- * @return the supplierAddress
- */
- public String getSupplierAddress() {
- return supplierAddress;
- }
-
- /**
- * @param supplierAddress
- * the supplierAddress to set
- */
- public void setSupplierAddress(String supplierAddress) {
- this.supplierAddress = supplierAddress;
- }
-
- /**
- * @return the quantityOrder
- */
- public int getQuantityOrder() {
- return quantityOrder;
- }
-
- /**
- * @param quantityOrder
- * the quantityOrder to set
- */
- public void setQuantityOrder(int quantityOrder) {
- this.quantityOrder = quantityOrder;
- }
-
- /**
- * @return the orderId
- */
- public int getOrderId() {
- return orderId;
- }
-
- /**
- * @param orderId
- * the orderId to set
- */
- public void setOrderId(int orderId) {
- this.orderId = orderId;
- }
-
- /**
- * @return the amount
- */
- public double getAmount() {
- return amount;
- }
-
- /**
- * @param amount
- * the amount to set
- */
- public void setAmount(double amount) {
- this.amount = amount;
- }
-
- /**
- * @return the goodsList
- */
- public List getGoodsList() {
- return goodsList;
- }
-
- /**
- * @param goodsList
- * the goodsList to set
- */
- public void setGoodsList(List goodsList) {
- this.goodsList = goodsList;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Supplier [supplierId=" + supplierId + ", supplierName=" + supplierName + ", supplierAddress="
- + supplierAddress + ", quantityOrder=" + quantityOrder + ", orderId=" + orderId + ", amount=" + amount
- + ", goodsList=" + goodsList + "]";
- }
-
-
-
-
-}
diff --git a/10SuperMarketServlet/src/repository/CustomerDAO.java b/10SuperMarketServlet/src/repository/CustomerDAO.java
deleted file mode 100644
index cfb9f3b7..00000000
--- a/10SuperMarketServlet/src/repository/CustomerDAO.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package repository;
-
-import model.Customer;
-
-public interface CustomerDAO {
-
-
- public int addCustomer(Customer c);
-
-
- public int updateCustomer(int customerID, String name);
-
-
- public int removeCustomer(int id);
-}
diff --git a/10SuperMarketServlet/src/repository/CustomerDAOImpl.java b/10SuperMarketServlet/src/repository/CustomerDAOImpl.java
deleted file mode 100644
index 4567a72b..00000000
--- a/10SuperMarketServlet/src/repository/CustomerDAOImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package repository;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-import model.Customer;
-@Repository
-@Qualifier("customerDAO")
-public class CustomerDAOImpl implements CustomerDAO {
-
- /*
- *
- */
- @Autowired
- private JdbcTemplate jdbcTemplate;
-
- /*public void setJdbcTemplate(final JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }*/
-
-
-
- @Override
- public int updateCustomer(final int customerID, final String name) {
-
- String query = "update customer set customerName=" + "'" + name + "'" + " where customerId=" + customerID;
- // String query = "update customer set customerName="+name+" where customerId="+
- // customerID;
-
- System.out.println(query);
- return jdbcTemplate.update(query);
-
- }
-
- @Override
- public int removeCustomer(final int identy) {
- final String query = "delete from customer where customerId="+identy;
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-
- @Override
- public int addCustomer(Customer c) {
- String query = "insert into customer values('" + c.getCustomerId() + "','" + c.getCustomerName() + "','"
- + c.getCustomerAddress() + "','" + c.getPaymentMode() + "')";
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-}
diff --git a/10SuperMarketServlet/src/repository/GoodsDAO.java b/10SuperMarketServlet/src/repository/GoodsDAO.java
deleted file mode 100644
index bffefd8c..00000000
--- a/10SuperMarketServlet/src/repository/GoodsDAO.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package repository;
-
-import model.Goods;
-
-public interface GoodsDAO {
-
- public int addGoods(int goodsId, String goodsName, int goodsQuantity,
- double goodsPrice);
-
- public int removeGoods(int goodsId);
-
- public int updateGoods(int goodsId,String goodsName);
-}
diff --git a/10SuperMarketServlet/src/repository/GoodsDAOImpl.java b/10SuperMarketServlet/src/repository/GoodsDAOImpl.java
deleted file mode 100644
index 7a15f84b..00000000
--- a/10SuperMarketServlet/src/repository/GoodsDAOImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package repository;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-import model.Goods;
-
-/**
- * @author Ram
- *
- */
-@Repository
-@Qualifier("GoodsDAO")
-public class GoodsDAOImpl implements GoodsDAO {
-
- // private DataSource dataSource;
-
- // private JdbcTemplate jdbcTemplate = new JdbcTemplate();
-
- /**
- * configuring a jdbc template
- */
- @Autowired
- private JdbcTemplate jdbcTemplate;
-
- /*public void setJdbcTemplate1(final JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }*/
-
- @Override
- public int addGoods(int goodsId, String goodsName, int goodsQuantity,
- double goodsPrice) {
- String query = "insert into goods values(" + goodsId + "," + "'" + goodsName + "'" + "," + goodsQuantity+ ","
- + goodsPrice + ")";
- System.out.println(query);
-
- return jdbcTemplate.update(query);
- }
-
- @Override
- public int updateGoods(int goodsId, String goodsName) {
- String query = "update goods set goodsName=" + "'" + goodsName + "'" + " where goodsId=" + goodsId;
- // String query = "update customer set customerName="+name+" where customerId="+
- // customerID;
-
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-
- @Override
- public int removeGoods(int goodsId) {
-
- String query = "delete from goods where goodsId=" + goodsId;
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-
- /*public JdbcTemplate getJdbcTemplate() {
- return jdbcTemplate;
- }
-
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }*/
-
-}
diff --git a/10SuperMarketServlet/src/repository/RetailerDAO.java b/10SuperMarketServlet/src/repository/RetailerDAO.java
deleted file mode 100644
index 5e3aeed7..00000000
--- a/10SuperMarketServlet/src/repository/RetailerDAO.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- *
- */
-package repository;
-
-import java.util.List;
-
-import model.Customer;
-import model.Goods;
-import model.Supplier;
-
-/**
- * @author trainee
- *
- */
-public interface RetailerDAO {
-
-
- int addRetailer(Supplier s);
-
-public List viewGoods();
-
-public List viewCustomer(int customerId );
-
-public List viewSupplier(int supplierId);
-
-
-}
diff --git a/10SuperMarketServlet/src/repository/RetailerDAOImpl.java b/10SuperMarketServlet/src/repository/RetailerDAOImpl.java
deleted file mode 100644
index 91e91ea8..00000000
--- a/10SuperMarketServlet/src/repository/RetailerDAOImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- *
- */
-package repository;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.DataAccessException;
-import org.springframework.jdbc.core.BeanPropertyRowMapper;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.ResultSetExtractor;
-import org.springframework.stereotype.Repository;
-
-import model.Customer;
-import model.Goods;
-import model.Supplier;
-
-/**
- * @author trainee
- *
- */
-
-@Repository("serviceDAO")
-public class RetailerDAOImpl implements RetailerDAO {
-
- @Autowired
- private JdbcTemplate jdbcTemplate;
-
- /*
- * @Override public int viewGoods() { // TODO Auto-generated method stub String
- * query = "select * from goods"; System.out.println(query); return
- * jdbcTemplate.update(query);
- *
- * }
- */
-
-
- @Override
- public List viewCustomer(final int customerId) {
- // TODO Auto-generated method stub
- List list = (List) jdbcTemplate.query(
- "SELECT * FROM customer where customerId = '" + customerId + "' ",
- new BeanPropertyRowMapper(Customer.class));
- System.out.println("In cust view");
- return list;
- }
-
-
- @Override
- public List viewSupplier(final int supplierId) {
- // TODO Auto-generated method stub
- List list = (List) jdbcTemplate.query(
- "SELECT * FROM supplier where supplierID = '" + supplierId + "' ",
- new BeanPropertyRowMapper(Supplier.class));
- System.out.println("In supplier view");
- return list;
- }
-
-
- public List viewGoods() {
- // TODO Auto-generated method stub
- List list = (List) jdbcTemplate.query(
- "SELECT * FROM goods",
- new BeanPropertyRowMapper(Goods.class));
- System.out.println("In goods view");
- return list;
- }
-
- @Override
- public int addRetailer(Supplier s) {
-
- String query = "insert into retailer values (" + "'" + s.getSupplierName() + "'" + "," + "'"
- + s.getSupplierAddress() + "'" + ")";
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-
-}
diff --git a/10SuperMarketServlet/src/repository/SupplierDAO.java b/10SuperMarketServlet/src/repository/SupplierDAO.java
deleted file mode 100644
index 3adab528..00000000
--- a/10SuperMarketServlet/src/repository/SupplierDAO.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package repository;
-
-public interface SupplierDAO {
-
- public int addSupplier(int supplierId, String supplierName,
- String supplierAddress, int quantityOrder, int orderId,
- double amount);
-
- public int removeSupplier(int supplierId);
-
- public int updateSupplier(int supplierId, String supplierName);
-
-}
diff --git a/10SuperMarketServlet/src/repository/SupplierDAOImpl.java b/10SuperMarketServlet/src/repository/SupplierDAOImpl.java
deleted file mode 100644
index f9236a7a..00000000
--- a/10SuperMarketServlet/src/repository/SupplierDAOImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package repository;
-
-import javax.sql.DataSource;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-
-@Repository
-@Qualifier("supplierDAO")
-public class SupplierDAOImpl implements SupplierDAO {
-
- private DataSource dataSource;
-@Autowired
-JdbcTemplate jdbcTemplate;
-
-
-
-
-
-
- @Override
- public int addSupplier(final int supplierId, final String supplierName, final String supplierAddress, final int quantityOrder, final int orderId,
- final double amount) {
- String Query = "insert into supplier values(" + supplierId + "," + "'" + supplierName + "'" + "," + "'"
- + supplierAddress + "'" + "," + quantityOrder + "," + orderId + "," + amount + ")";
- System.out.println(Query);
- return jdbcTemplate.update(Query);
- }
-
- @Override
- public int removeSupplier(int supplierId) {
-
- String query = "delete from supplier where supplierId=" + supplierId;
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-
-
- @Override
- public int updateSupplier(int supplierId, String supplierName) {
-
- String query = "update supplier set supplierName="+"'" +supplierName+"'"+ "where supplierId="+supplierId;
-
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-/*
- *//**
- * @return the jdbcTemplate
- *//*
- public JdbcTemplate getJdbcTemplate() {
- return jdbcTemplate;
- }
-
- *//**
- * @param jdbcTemplate
- * the jdbcTemplate to set
- *//*
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }*/
-
-}
diff --git a/10SuperMarketServlet/src/service/CustomerService.java b/10SuperMarketServlet/src/service/CustomerService.java
deleted file mode 100644
index fffc1be3..00000000
--- a/10SuperMarketServlet/src/service/CustomerService.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package service;
-
-import model.Customer;
-
-public interface CustomerService {
-
-
- //public String addCustomer(Customer e);
-// public String updateCustomer(int customerID, String name);
- //public int removeCustomer(int id);
- int addCustomer(Customer c);
- int updateCustomer(int customerId, String customerName);
- int removeCusotmer(int customerId);
-}
diff --git a/10SuperMarketServlet/src/service/CustomerServiceImpl.java b/10SuperMarketServlet/src/service/CustomerServiceImpl.java
deleted file mode 100644
index 985bf538..00000000
--- a/10SuperMarketServlet/src/service/CustomerServiceImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package service;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import model.Customer;
-import repository.CustomerDAO;
-
-/**
- * @author Ram
- */
-@Service("customerService")
-public class CustomerServiceImpl implements CustomerService {
-
- @Autowired
- private CustomerDAO customerDAO;
-
- /**
- * @param customerDAO
- */
- public CustomerServiceImpl(final CustomerDAO customerDAO) {
- super();
- this.customerDAO = customerDAO;
- }
-
- public CustomerServiceImpl() {
- // TODO Auto-generated constructor stub
- }
-
-
- public int addCustomer(final Customer c) {
- final int addData = customerDAO.addCustomer(c);
- return addData;
- }
-
- public int updateCustomer(int customerId, String customerName) {
- int updateData = customerDAO.updateCustomer(customerId, customerName);
- return updateData;
- }
-
- @Override
- public int removeCusotmer(int customerId) {
- int removeData = customerDAO.removeCustomer(customerId);
- return removeData;
- }
-
-}
diff --git a/10SuperMarketServlet/src/service/GoodsService.java b/10SuperMarketServlet/src/service/GoodsService.java
deleted file mode 100644
index 345474c1..00000000
--- a/10SuperMarketServlet/src/service/GoodsService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package service;
-
-import model.Goods;
-
-public interface GoodsService {
-
- /**
- * @method this method is calling a Repository Goods which connect to database
- * table Goods and adding goodsID, name,quantity,price
- *
- */
- int addGoods(int goodsId, String goodsName, int goodsQuantity,
- double goodsPrice);
-
- /**
- * @method this method is calling a Repository Goods which connect to database
- * table Goods and removing a perticular Goods from table
- *
- */
- int removeGoods(int goodsId);
-
- /**
- * @method this method is calling a Repository Goods which connect to database
- * table Goods and updating a perticular Goods
- *
- */
- int updateGoods(int goodsId, String goodsName);
- // public String orderGoods(int goodsId);
-
-}
diff --git a/10SuperMarketServlet/src/service/GoodsServiceImpl.java b/10SuperMarketServlet/src/service/GoodsServiceImpl.java
deleted file mode 100644
index 92d25e31..00000000
--- a/10SuperMarketServlet/src/service/GoodsServiceImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package service;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import model.Goods;
-import repository.GoodsDAO;
-
-@Service("goodsService")
-public class GoodsServiceImpl implements GoodsService {
-
- public GoodsServiceImpl() {
-
- }
-
- @Autowired
- private GoodsDAO goodsdao;
-
- public GoodsServiceImpl(final GoodsDAO goodsdao) {
- super();
- this.goodsdao = goodsdao;
- }
-
- @Override
- public int addGoods(int goodsId, String goodsName, int goodsQuantity,
- double goodsPrice) {
-
- int addData = goodsdao.addGoods(goodsId,goodsName,goodsQuantity,goodsPrice);
- return addData;
- }
-
- @Override
- public int removeGoods(int goodsId) {
- // GoodsDAO goodsDAO = null;
- int remmoveData = goodsdao.removeGoods(goodsId);
- return remmoveData;
- }
-
- @Override
- public int updateGoods(int goodsId, String goodsName) {
- // GoodsDAO goodsDAO = null;
- int updateData = goodsdao.updateGoods(goodsId, goodsName);
- return updateData;
- }
-
-}
diff --git a/10SuperMarketServlet/src/service/RetailerService.java b/10SuperMarketServlet/src/service/RetailerService.java
deleted file mode 100644
index 536690d0..00000000
--- a/10SuperMarketServlet/src/service/RetailerService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- *
- */
-package service;
-
-import java.util.List;
-
-import model.Customer;
-import model.Goods;
-import model.Supplier;
-
-/**
- * @author trainee
- *
- */
-public interface RetailerService {
-
- //int addSupplier(String supplierName, String supplierAddress);
-
- int addRetailer(Supplier s);
-
-
-public List viewGoods();
-
-public List viewCustomer(int customerId );
-
-public List viewSupplier(int supplierId);
-
-
-}
diff --git a/10SuperMarketServlet/src/service/RetailerServiceImpl.java b/10SuperMarketServlet/src/service/RetailerServiceImpl.java
deleted file mode 100644
index 3f2b8921..00000000
--- a/10SuperMarketServlet/src/service/RetailerServiceImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- *
- */
-package service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import model.Customer;
-import model.Goods;
-import model.Supplier;
-import repository.CustomerDAO;
-import repository.RetailerDAO;
-import repository.RetailerDAOImpl;
-
-/**
- * @author trainee
- *
- */
-@Service("retailerService")
-public class RetailerServiceImpl implements RetailerService {
-
- @Autowired
- private RetailerDAO retailerDao;
-
- @Override
- public int addRetailer(final Supplier s) {
-
- return retailerDao.addRetailer(s);
-
- }
-
- public List viewCustomer(int customerId ) {
- List customerList = new ArrayList();
- customerList = retailerDao.viewCustomer(customerId);
- return customerList;
- }
-
- @Override
- public List viewSupplier(final int supplierId) {
- // TODO Auto-generated method stub
- return retailerDao.viewSupplier(supplierId);
- }
-
- @Override
- public List viewGoods() {
- // TODO Auto-generated method stub
- return retailerDao.viewGoods();
- }
-
-}
diff --git a/10SuperMarketServlet/src/service/SupplierService.java b/10SuperMarketServlet/src/service/SupplierService.java
deleted file mode 100644
index b230abd2..00000000
--- a/10SuperMarketServlet/src/service/SupplierService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package service;
-
-/**
- * this interface contains various operations.
- */
-public interface SupplierService {
-
- /**
- * this method is used to invoke the Repository method addSupplier
- * which will hit the databases.
- *
- */
- int addSupplier(int supplierId, String supplierName,
- String supplierAddress, int quantityOrder, int orderId,
- double amount);
- /**
- * this method is used to invoke the Repository method removeSupplier
- * which will hit the databases.
- *
- */
- int removeSupplier(int supplierId);
-
- /**
- * this method is used to invoke the Repository method addSupplier
- * which will hit the databases.
- *
- */
- int updateSupplier(int supplierId,String supplierName);
-
-}
diff --git a/10SuperMarketServlet/src/service/SupplierServiceImpl.java b/10SuperMarketServlet/src/service/SupplierServiceImpl.java
deleted file mode 100644
index 1ea11f11..00000000
--- a/10SuperMarketServlet/src/service/SupplierServiceImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package service;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import repository.SupplierDAO;
-
-/**
- * this class implementing methods of its parent interface
- */
-
-@Service("supplierService")
-public class SupplierServiceImpl implements SupplierService {
-
- /**
- * @param supplierDAO
- * this will be used to access DAO methods
- */
- @Autowired
- private SupplierDAO supplierDAO;
-
- /**
- * @param supplierDAO
- */
-
- @Override
- public int addSupplier(final int supplierId, final String supplierName, final String supplierAddress,
- final int quantityOrder, final int orderId, final double amount) {
-
- // SupplierDAO supplierDAO = null;
- final int addData = supplierDAO.addSupplier(supplierId, supplierName, supplierAddress, quantityOrder, orderId,
- amount);
- return addData;
-
- }
-
- @Override
- public int removeSupplier(final int supplierId) {
- // final SupplierDAO supplierDAO = null;
- final int removeData = supplierDAO.removeSupplier(supplierId);
- return removeData;
- }
-
- @Override
- public int updateSupplier(final int supplierId, final String supplierName) {
- final SupplierDAO supplierDAO = null;
- int removeData = supplierDAO.updateSupplier(supplierId, supplierName);
- return removeData;
- }
-
-}
diff --git a/11SpringBootUsingJDBC/.gitignore b/11SpringBootUsingJDBC/.gitignore
deleted file mode 100644
index 82eca336..00000000
--- a/11SpringBootUsingJDBC/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/build/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
\ No newline at end of file
diff --git a/11SpringBootUsingJDBC/.mvn/wrapper/maven-wrapper.jar b/11SpringBootUsingJDBC/.mvn/wrapper/maven-wrapper.jar
deleted file mode 100644
index 9cc84ea9..00000000
Binary files a/11SpringBootUsingJDBC/.mvn/wrapper/maven-wrapper.jar and /dev/null differ
diff --git a/11SpringBootUsingJDBC/.mvn/wrapper/maven-wrapper.properties b/11SpringBootUsingJDBC/.mvn/wrapper/maven-wrapper.properties
deleted file mode 100644
index b573bb50..00000000
--- a/11SpringBootUsingJDBC/.mvn/wrapper/maven-wrapper.properties
+++ /dev/null
@@ -1 +0,0 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
diff --git a/11SpringBootUsingJDBC/bin/.gitignore b/11SpringBootUsingJDBC/bin/.gitignore
deleted file mode 100644
index 82eca336..00000000
--- a/11SpringBootUsingJDBC/bin/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/build/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
\ No newline at end of file
diff --git a/11SpringBootUsingJDBC/bin/.mvn/wrapper/maven-wrapper.jar b/11SpringBootUsingJDBC/bin/.mvn/wrapper/maven-wrapper.jar
deleted file mode 100644
index 9cc84ea9..00000000
Binary files a/11SpringBootUsingJDBC/bin/.mvn/wrapper/maven-wrapper.jar and /dev/null differ
diff --git a/11SpringBootUsingJDBC/bin/.mvn/wrapper/maven-wrapper.properties b/11SpringBootUsingJDBC/bin/.mvn/wrapper/maven-wrapper.properties
deleted file mode 100644
index b573bb50..00000000
--- a/11SpringBootUsingJDBC/bin/.mvn/wrapper/maven-wrapper.properties
+++ /dev/null
@@ -1 +0,0 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
diff --git a/11SpringBootUsingJDBC/bin/mvnw b/11SpringBootUsingJDBC/bin/mvnw
deleted file mode 100644
index 5bf251c0..00000000
--- a/11SpringBootUsingJDBC/bin/mvnw
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/11SpringBootUsingJDBC/bin/mvnw.cmd b/11SpringBootUsingJDBC/bin/mvnw.cmd
deleted file mode 100644
index 019bd74d..00000000
--- a/11SpringBootUsingJDBC/bin/mvnw.cmd
+++ /dev/null
@@ -1,143 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/11SpringBootUsingJDBC/bin/pom.xml b/11SpringBootUsingJDBC/bin/pom.xml
deleted file mode 100644
index 2d1e8c87..00000000
--- a/11SpringBootUsingJDBC/bin/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
- 4.0.0
-
- com.example
- demo
- 0.0.1-SNAPSHOT
- jar
-
- demo
- Demo project for Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.1.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
diff --git a/11SpringBootUsingJDBC/bin/src/main/java/com/example/demo/DemoApplication.class b/11SpringBootUsingJDBC/bin/src/main/java/com/example/demo/DemoApplication.class
deleted file mode 100644
index 54d0e034..00000000
Binary files a/11SpringBootUsingJDBC/bin/src/main/java/com/example/demo/DemoApplication.class and /dev/null differ
diff --git a/11SpringBootUsingJDBC/bin/src/main/resources/application.properties b/11SpringBootUsingJDBC/bin/src/main/resources/application.properties
deleted file mode 100644
index e69de29b..00000000
diff --git a/11SpringBootUsingJDBC/bin/src/test/java/com/example/demo/DemoApplicationTests.class b/11SpringBootUsingJDBC/bin/src/test/java/com/example/demo/DemoApplicationTests.class
deleted file mode 100644
index 37114bbd..00000000
Binary files a/11SpringBootUsingJDBC/bin/src/test/java/com/example/demo/DemoApplicationTests.class and /dev/null differ
diff --git a/11SpringBootUsingJDBC/mvnw b/11SpringBootUsingJDBC/mvnw
deleted file mode 100644
index 5bf251c0..00000000
--- a/11SpringBootUsingJDBC/mvnw
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/11SpringBootUsingJDBC/mvnw.cmd b/11SpringBootUsingJDBC/mvnw.cmd
deleted file mode 100644
index 019bd74d..00000000
--- a/11SpringBootUsingJDBC/mvnw.cmd
+++ /dev/null
@@ -1,143 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/11SpringBootUsingJDBC/pom.xml b/11SpringBootUsingJDBC/pom.xml
deleted file mode 100644
index 5652055f..00000000
--- a/11SpringBootUsingJDBC/pom.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
- 4.0.0
-
- com.example
- demo
- 0.0.1-SNAPSHOT
- jar
-
- demo
- Demo project for Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.1.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- javax.servlet
- servlet-api
- 2.5
- provided
-
-
-
- org.springframework
- spring-context
- 5.0.5.RELEASE
-
-
-
- jstl
- jstl
- 1.2
-
-
- mysql
- mysql-connector-java
- 5.1.38
-
-
-
-
- org.springframework
- spring-jdbc
- 5.0.5.RELEASE
-
-
-
- org.springframework
- spring-context
- 5.0.5.RELEASE
-
-
-
- org.springframework
- spring-tx
- 5.0.5.RELEASE
-
-
-
- junit
- junit
- 4.11
- test
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
diff --git a/11SpringBootUsingJDBC/src/main/java/MainServlet/DemoServlet.java b/11SpringBootUsingJDBC/src/main/java/MainServlet/DemoServlet.java
deleted file mode 100644
index 68892074..00000000
--- a/11SpringBootUsingJDBC/src/main/java/MainServlet/DemoServlet.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package MainServlet;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-
-import controller.AppJavaConfig;
-import model.Customer;
-import model.Goods;
-import service.CustomerService;
-import service.CustomerServiceImpl;
-import service.RetailerService;
-import service.RetailerServiceImpl;
-
-/**
- * Servlet implementation class DemoServlet
- */
-
-// @WebServlet("/ramServlet")
-public class DemoServlet extends HttpServlet {
-
- /**
- * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
- * response)
- */
-
- protected void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
-
- response.setContentType("text/html");
-
- ApplicationContext context = new AnnotationConfigApplicationContext(AppJavaConfig.class);
- // CustomerService customerService = (CustomerService)
- // context.getBean("customerService",CustomerServiceImpl.class);
- RetailerService retailerService = (RetailerService) context.getBean("retailerService",
- RetailerServiceImpl.class);
-
- final String ID = request.getParameter("id");
- final int id = Integer.parseInt(ID);
-
- List customerList = retailerService.viewCustomer(id);
- // List goodsList = retailerService.viewGoods();
-
- // request.setAttribute("glist", goodsList);
- request.setAttribute("list", customerList);
-
- RequestDispatcher requestDispatcher = request.getRequestDispatcher("home1.jsp");
- // RequestDispatcher requestDispatchergoods =
- // request.getRequestDispatcher("viewgoods.jsp");
- requestDispatcher.forward(request, response);
- // requestDispatchergoods.forward(request, response);
- }
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/MainServlet/DemoServlet2.java b/11SpringBootUsingJDBC/src/main/java/MainServlet/DemoServlet2.java
deleted file mode 100644
index 8d1b4e97..00000000
--- a/11SpringBootUsingJDBC/src/main/java/MainServlet/DemoServlet2.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package MainServlet;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-
-import controller.AppJavaConfig;
-import model.Customer;
-import model.Goods;
-import service.CustomerService;
-import service.CustomerServiceImpl;
-import service.RetailerService;
-import service.RetailerServiceImpl;
-
-/**
- * Servlet implementation class DemoServlet
- */
-
-// @WebServlet("/ramServlet")
-public class DemoServlet2 extends HttpServlet {
-
- /**
- * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
- * response)
- */
-
- protected void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
-
- response.setContentType("text/html");
- ApplicationContext context = new AnnotationConfigApplicationContext(AppJavaConfig.class);
- //CustomerService customerService = (CustomerService) context.getBean("customerService",CustomerServiceImpl.class);
- RetailerService retailerService = (RetailerService) context.getBean("retailerService",
- RetailerServiceImpl.class);
- // List customerList = retailerService.viewCustomer(106);
- List goodsList = retailerService.viewGoods();
-
-
-
- request.setAttribute("glist", goodsList);
- // request.setAttribute("list", customerList);
-
- // RequestDispatcher requestDispatcher = request.getRequestDispatcher("home1.jsp");
- RequestDispatcher requestDispatchergoods = request.getRequestDispatcher("viewgoods.jsp");
- //requestDispatcher.forward(request, response);
- requestDispatchergoods.forward(request, response);
- }
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/MainServlet/DemoServlet3.java b/11SpringBootUsingJDBC/src/main/java/MainServlet/DemoServlet3.java
deleted file mode 100644
index ec8ecce7..00000000
--- a/11SpringBootUsingJDBC/src/main/java/MainServlet/DemoServlet3.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package MainServlet;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-
-import controller.AppJavaConfig;
-import model.Customer;
-import model.Goods;
-import model.Supplier;
-import service.CustomerService;
-import service.CustomerServiceImpl;
-import service.RetailerService;
-import service.RetailerServiceImpl;
-
-/**
- * Servlet implementation class DemoServlet
- */
-
-// @WebServlet("/ramServlet")
-public class DemoServlet3 extends HttpServlet {
-
- /**
- * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
- * response)
- */
-
- protected void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
-
- response.setContentType("text/html");
- ApplicationContext context = new AnnotationConfigApplicationContext(AppJavaConfig.class);
- //CustomerService customerService = (CustomerService) context.getBean("customerService",CustomerServiceImpl.class);
- RetailerService retailerService = (RetailerService) context.getBean("retailerService",
- RetailerServiceImpl.class);
-
-
- String ID = request.getParameter("id1");
- try {
- int id1 = Integer.parseInt(ID);
-
-
-
-
- // List customerList = retailerService.viewCustomer(106);
-
- List supplierList = retailerService.viewSupplier(id1);
-
-
-
-
- request.setAttribute("slist", supplierList);
- // request.setAttribute("list", customerList);
-
- // RequestDispatcher requestDispatcher = request.getRequestDispatcher("home1.jsp");
- RequestDispatcher requestDispatcherSupplier = request.getRequestDispatcher("viewsupplier.jsp");
- //requestDispatcher.forward(request, response);
- requestDispatcherSupplier.forward(request, response);
- }catch (NumberFormatException e){
- System.out.println("not a number");
- }
- }
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/com/example/demo/CustomErrorType.java b/11SpringBootUsingJDBC/src/main/java/com/example/demo/CustomErrorType.java
deleted file mode 100644
index 0de185b3..00000000
--- a/11SpringBootUsingJDBC/src/main/java/com/example/demo/CustomErrorType.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.example.demo;
-
-
-public class CustomErrorType {
-
- private String errorMessage;
-
- public CustomErrorType(String errorMessage){
- this.errorMessage = errorMessage;
- }
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
-}
\ No newline at end of file
diff --git a/11SpringBootUsingJDBC/src/main/java/com/example/demo/CustomersOp.java b/11SpringBootUsingJDBC/src/main/java/com/example/demo/CustomersOp.java
deleted file mode 100644
index 8f1c7782..00000000
--- a/11SpringBootUsingJDBC/src/main/java/com/example/demo/CustomersOp.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package com.example.demo;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import model.Customer;
-import service.CustomerService;
-import service.RetailerService;
-
-@RestController
-public class CustomersOp {
-
- @Autowired
- private RetailerService rs;
-
- @Autowired
- private CustomerService customerService;
-
- //
- @RequestMapping(value = "/user/{customerId}", method = RequestMethod.GET)
- public ResponseEntity> getUser(@PathVariable("customerId") int customerId) {
- System.out.printf("User with id {} is :", customerId);
- List user = rs.viewCustomer(customerId);
- if (user == null) {
- System.out.printf("User with id {} not found.", customerId);
- return new ResponseEntity(new CustomErrorType("User with id " + customerId + " not found"),
- HttpStatus.NOT_FOUND);
- }
- return new ResponseEntity(user, HttpStatus.OK);
- }
-
- // Add customer
-
- @RequestMapping(value = "/addNewCustomer", method = RequestMethod.GET)
- public Customer NewUser() {
-
- Customer c = new Customer(24, "hulk", "newyork", "Debit");
- customerService.addCustomer(c);
-
- return null;
-
- }
-
- @RequestMapping(value = "/deleteuser/{id}", method = RequestMethod.GET)
- public Customer deleteUser(@PathVariable("id") int id) {
- System.out.printf("Fetching & Deleting User with id {}", id);
-
- customerService.removeCusotmer(id);
- return null;
- }
-
- @RequestMapping(value = "/updateuser/{id}/{name}", method = RequestMethod.GET)
- @ResponseBody
- public int updateUser(@PathVariable("id") int id, @PathVariable("name") String name) {
- System.out.printf("Updating User with id {}", id);
-
- final int dummy = customerService.updateCustomer(id, name);
-
- return dummy;
- }
-
- /*
- * @RequestMapping("/showcustomer") public @ResponseBody List
- * addCustomer() { System.out.println("hi"); //return "hi to browser";
- *
- * //ApplicationContext context = new
- * AnnotationConfigApplicationContext(AppJavaConfig.class); //CustomerService
- * customerService = (CustomerService)
- * context.getBean("customerService",CustomerServiceImpl.class); RetailerService
- * retailerService = (RetailerService) context.getBean("retailerService",
- * RetailerServiceImpl.class);
- *
- *
- *
- * List customerList = rs.viewCustomer(1);
- *
- * return customerList;
- *
- *
- *
- *
- *
- *
- * }
- */
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/com/example/demo/DemoApplication.java b/11SpringBootUsingJDBC/src/main/java/com/example/demo/DemoApplication.java
deleted file mode 100644
index 44c49287..00000000
--- a/11SpringBootUsingJDBC/src/main/java/com/example/demo/DemoApplication.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.example.demo;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.ComponentScan;
-
-@SpringBootApplication
-@ComponentScan({ "service", "repository", "controller", "com.example.demo" })
-public class DemoApplication {
-
- public static void main(String[] args) {
-
- SpringApplication.run(DemoApplication.class, args);
-
- System.out.println("HEllo World");
-
- }
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/controller/AppJavaConfig.java b/11SpringBootUsingJDBC/src/main/java/controller/AppJavaConfig.java
deleted file mode 100644
index 6aca2c56..00000000
--- a/11SpringBootUsingJDBC/src/main/java/controller/AppJavaConfig.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package controller;
-
-import javax.sql.DataSource;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.core.env.Environment;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.datasource.DriverManagerDataSource;
-
-/**
- * @class this is java configuration file
- */
-@Configuration
-@ComponentScan({ "service", "repository", "controller" })
-@PropertySource(value = { "classpath:database.properties" })
-public class AppJavaConfig {
-
- @Autowired
- Environment environment;
-
- @Bean
- DataSource dataSource() {
- final DriverManagerDataSource driverManagerDataSource = new DriverManagerDataSource();
- driverManagerDataSource.setUrl(environment.getProperty("url"));
- driverManagerDataSource.setUsername(environment.getProperty("dbuser"));
- driverManagerDataSource.setPassword(environment.getProperty("dbpassword"));
- driverManagerDataSource.setDriverClassName(environment.getProperty("driver"));
- return driverManagerDataSource;
- }
-
- @Bean
- JdbcTemplate jdbcTempalte(DataSource dataSource) {
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- return jdbcTemplate;
- }
-
-
- /*
- * @Bean public CustomerDAO customerDaoBean() { return new CustomerDAOImpl(); }
- *
- * @Bean public GoodsDAO goodsDAOBean() { return new GoodsDAOImpl(); }
- *
- * @Bean public SupplierDAO supplierDAOBean() { return new SupplierDAOImpl(); }
- */
-
- /**
- * this is CustomerService bean used to invoke the services
- */
- /*
- * @Bean public RetailerDAO retailerDAOBean() { return new RetailerDAOImpl(); }
- *
- *//**
- * this is CustomerService bean used to invoke the services
- *//*
- * @Bean public CustomerService customerService() { return new
- * CustomerServiceImpl(); }
- */
-
- /**
- * this is GoodsService bean used to invoke the services
- */
- /*
- * @Bean public GoodsService goodsService() { return new GoodsServiceImpl(); }
- *
- * @Bean public SupplierService supplierService() { return new
- * SupplierServiceImpl(); }
- *
- * @Bean public RetailerService retailerService() { return new
- * RetailerServiceImpl(); }
- */
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/model/Customer.java b/11SpringBootUsingJDBC/src/main/java/model/Customer.java
deleted file mode 100644
index 86ec6b13..00000000
--- a/11SpringBootUsingJDBC/src/main/java/model/Customer.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package model;
-
-/**
- * @author Ram
- *
- */
-
-
-
-
-/**
- * @class this class represent a customer entity
- *
- */
-public class Customer {
-
- /**
- * @field this is use to provide particular id which will represent a whole
- * record in table
- */
- private int customerId;
-
- /**
- * @field this is use to provide particular id which will represent a whole
- * record in table
- */
- private String customerName;
- /**
- * @field this is use to represent a name of the customer
- *
- */
- private String customerAddress;
- /**
- * @field this is use to represent a payment of the customer
- *
- */
- private String paymentMode;
-
- /**
- * @param customerId
- * @param customerName
- * @param customerAddress
- * @param paymentMode
- */
- public Customer(final int customerId, final String customerName, final String customerAddress,
- final String paymentMode) {
- this.customerId = customerId;
- this.customerName = customerName;
- this.customerAddress = customerAddress;
- this.paymentMode = paymentMode;
- }
-
- /**
- *
- * @param customerName
- *
- */
- public Customer(final String customerName) {
-
- this.customerName = customerName;
-
- }
-
- /**
- *
- * @constructor this is default constructor
- *
- */
- public Customer() {
-
- }
-
- /**
- * @return the customerId
- */
- public int getCustomerId() {
- return customerId;
- }
-
- /**
- * @param customerId
- * the customerId to set
- */
- public void setCustomerId(final int customerId) {
- this.customerId = customerId;
- }
-
- /**
- * @return the customerName
- */
- public String getCustomerName() {
- return customerName;
- }
-
- /**
- * @param customerName
- * the customerName to set
- */
- public void setCustomerName(final String customerName) {
- this.customerName = customerName;
- }
-
- /**
- * @return the customerAddress
- */
- public String getCustomerAddress() {
- return customerAddress;
- }
-
- /**
- * @param customerAddress
- * the customerAddress to set
- */
- public void setCustomerAddress(final String customerAddress) {
- this.customerAddress = customerAddress;
- }
-
- /**
- * @return the paymentMode
- */
- public String getPaymentMode() {
- return paymentMode;
- }
-
- /**
- * @param paymentMode
- * the paymentMode to set
- */
- public void setPaymentMode(final String paymentMode) {
- this.paymentMode = paymentMode;
- }
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/model/Goods.java b/11SpringBootUsingJDBC/src/main/java/model/Goods.java
deleted file mode 100644
index 8a0ffeb1..00000000
--- a/11SpringBootUsingJDBC/src/main/java/model/Goods.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package model;
-
-public class Goods {
-
-
- private int goodsId;
- private String goodsName;
- private int goodsQuantity;
- private double goodsPrice;
-
- /**
- * @param goodsId
- * @param goodsName
- * @param goodsQuantity
- * @param goodsPrice
- */
- public Goods(final int goodsId, final String goodsName, final int goodsQuantity,
- final double goodsPrice) {
- this.goodsId = goodsId;
- this.goodsName = goodsName;
- this.goodsQuantity = goodsQuantity;
- this.goodsPrice = goodsPrice;
- }
-
- public Goods() {
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @return the goodsId
- */
- public int getGoodsId() {
- return goodsId;
- }
-
- /**
- * @param goodsId
- * the goodsId to set
- */
- public void setGoodsId(int goodsId) {
- this.goodsId = goodsId;
- }
-
- /**
- * @return the goodsName
- */
- public String getGoodsName() {
- return goodsName;
- }
-
- /**
- * @param goodsName
- * the goodsName to set
- */
- public void setGoodsName(String goodsName) {
- this.goodsName = goodsName;
- }
-
- /**
- * @return the goodsQuantity
- */
- public int getGoodsQuantity() {
- return goodsQuantity;
- }
-
- /**
- * @param goodsQuantity
- * the goodsQuantity to set
- */
- public void setGoodsQuantity(int goodsQuantity) {
- this.goodsQuantity = goodsQuantity;
- }
-
- /**
- * @return the goodsPrice
- */
- public double getGoodsPrice() {
- return goodsPrice;
- }
-
- /**
- * @param goodsPrice
- * the goodsPrice to set
- */
- public void setGoodsPrice(double goodsPrice) {
- this.goodsPrice = goodsPrice;
- }
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/model/Retailer.java b/11SpringBootUsingJDBC/src/main/java/model/Retailer.java
deleted file mode 100644
index db73d143..00000000
--- a/11SpringBootUsingJDBC/src/main/java/model/Retailer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-
-package model;
-
-/**
- * @author Ram
- *
- */
-public class Retailer {
-
- private String retailerName;
- private String retailerAddres;
- /**
- * @param retailerName
- * @param retailerAddres
- */
-
- public Retailer ()
- {
-
- }
-
-
- public Retailer(String retailerName, String retailerAddres) {
- this.retailerName = retailerName;
- this.retailerAddres = retailerAddres;
- }
-
- /**
- * @return the retailerName
- */
- public String getRetailerName() {
- return retailerName;
- }
-
- /**
- * @param retailerName
- * the retailerName to set
- */
- public void setRetailerName(String retailerName) {
- this.retailerName = retailerName;
- }
-
- /**
- * @return the retailerAddres
- */
- public String getRetailerAddres() {
- return retailerAddres;
- }
-
- /**
- * @param retailerAddres
- * the retailerAddres to set
- */
- public void setRetailerAddres(String retailerAddres) {
- this.retailerAddres = retailerAddres;
- }
-
-
-
-
-
-
-
-
-
-
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/model/Supplier.java b/11SpringBootUsingJDBC/src/main/java/model/Supplier.java
deleted file mode 100644
index 00ffc730..00000000
--- a/11SpringBootUsingJDBC/src/main/java/model/Supplier.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package model;
-
-import java.util.List;
-
-/**
- * @author Sumit
- *
- */
-public class Supplier {
-
- private int supplierId;
- private String supplierName;
- private String supplierAddress;
- private int quantityOrder;
- private int orderId;
- private double amount;
- List goodsList;
-
- /**
- * @param supplierId
- * @param supplierName
- * @param supplierAddress
- * @param quantityOrder
- * @param orderId
- * @param amount
- * @param goodsList
- */
- public Supplier(int supplierId, String supplierName,
- String supplierAddress, int quantityOrder, int orderId,
- double amount, List goodsList) {
- this.supplierId = supplierId;
- this.supplierName = supplierName;
- this.supplierAddress = supplierAddress;
- this.quantityOrder = quantityOrder;
- this.orderId = orderId;
- this.amount = amount;
- this.goodsList = goodsList;
- }
-
- public Supplier() {
- // TODO Auto-generated constructor stub
- }
-
- public Supplier(int supplierId, String supplierName,
- String supplierAddress, int quantityOrder, int orderId,
- double amount) {
- this.supplierId = supplierId;
- this.supplierName = supplierName;
- this.supplierAddress = supplierAddress;
- this.quantityOrder = quantityOrder;
- this.orderId = orderId;
- this.amount = amount;
- }
-
- /**
- * @return the supplierId
- */
- public int getSupplierId() {
- return supplierId;
- }
-
- /**
- * @param supplierId
- * the supplierId to set
- */
- public void setSupplierId(int supplierId) {
- this.supplierId = supplierId;
- }
-
- /**
- * @return the supplierName
- */
- public String getSupplierName() {
- return supplierName;
- }
-
- /**
- * @param supplierName
- * the supplierName to set
- */
- public void setSupplierName(String supplierName) {
- this.supplierName = supplierName;
- }
-
- /**
- * @return the supplierAddress
- */
- public String getSupplierAddress() {
- return supplierAddress;
- }
-
- /**
- * @param supplierAddress
- * the supplierAddress to set
- */
- public void setSupplierAddress(String supplierAddress) {
- this.supplierAddress = supplierAddress;
- }
-
- /**
- * @return the quantityOrder
- */
- public int getQuantityOrder() {
- return quantityOrder;
- }
-
- /**
- * @param quantityOrder
- * the quantityOrder to set
- */
- public void setQuantityOrder(int quantityOrder) {
- this.quantityOrder = quantityOrder;
- }
-
- /**
- * @return the orderId
- */
- public int getOrderId() {
- return orderId;
- }
-
- /**
- * @param orderId
- * the orderId to set
- */
- public void setOrderId(int orderId) {
- this.orderId = orderId;
- }
-
- /**
- * @return the amount
- */
- public double getAmount() {
- return amount;
- }
-
- /**
- * @param amount
- * the amount to set
- */
- public void setAmount(double amount) {
- this.amount = amount;
- }
-
- /**
- * @return the goodsList
- */
- public List getGoodsList() {
- return goodsList;
- }
-
- /**
- * @param goodsList
- * the goodsList to set
- */
- public void setGoodsList(List goodsList) {
- this.goodsList = goodsList;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Supplier [supplierId=" + supplierId + ", supplierName=" + supplierName + ", supplierAddress="
- + supplierAddress + ", quantityOrder=" + quantityOrder + ", orderId=" + orderId + ", amount=" + amount
- + ", goodsList=" + goodsList + "]";
- }
-
-
-
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/repository/CustomerDAO.java b/11SpringBootUsingJDBC/src/main/java/repository/CustomerDAO.java
deleted file mode 100644
index cfb9f3b7..00000000
--- a/11SpringBootUsingJDBC/src/main/java/repository/CustomerDAO.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package repository;
-
-import model.Customer;
-
-public interface CustomerDAO {
-
-
- public int addCustomer(Customer c);
-
-
- public int updateCustomer(int customerID, String name);
-
-
- public int removeCustomer(int id);
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/repository/CustomerDAOImpl.java b/11SpringBootUsingJDBC/src/main/java/repository/CustomerDAOImpl.java
deleted file mode 100644
index 4567a72b..00000000
--- a/11SpringBootUsingJDBC/src/main/java/repository/CustomerDAOImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package repository;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-import model.Customer;
-@Repository
-@Qualifier("customerDAO")
-public class CustomerDAOImpl implements CustomerDAO {
-
- /*
- *
- */
- @Autowired
- private JdbcTemplate jdbcTemplate;
-
- /*public void setJdbcTemplate(final JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }*/
-
-
-
- @Override
- public int updateCustomer(final int customerID, final String name) {
-
- String query = "update customer set customerName=" + "'" + name + "'" + " where customerId=" + customerID;
- // String query = "update customer set customerName="+name+" where customerId="+
- // customerID;
-
- System.out.println(query);
- return jdbcTemplate.update(query);
-
- }
-
- @Override
- public int removeCustomer(final int identy) {
- final String query = "delete from customer where customerId="+identy;
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-
- @Override
- public int addCustomer(Customer c) {
- String query = "insert into customer values('" + c.getCustomerId() + "','" + c.getCustomerName() + "','"
- + c.getCustomerAddress() + "','" + c.getPaymentMode() + "')";
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/repository/GoodsDAO.java b/11SpringBootUsingJDBC/src/main/java/repository/GoodsDAO.java
deleted file mode 100644
index bffefd8c..00000000
--- a/11SpringBootUsingJDBC/src/main/java/repository/GoodsDAO.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package repository;
-
-import model.Goods;
-
-public interface GoodsDAO {
-
- public int addGoods(int goodsId, String goodsName, int goodsQuantity,
- double goodsPrice);
-
- public int removeGoods(int goodsId);
-
- public int updateGoods(int goodsId,String goodsName);
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/repository/GoodsDAOImpl.java b/11SpringBootUsingJDBC/src/main/java/repository/GoodsDAOImpl.java
deleted file mode 100644
index 7a15f84b..00000000
--- a/11SpringBootUsingJDBC/src/main/java/repository/GoodsDAOImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package repository;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-import model.Goods;
-
-/**
- * @author Ram
- *
- */
-@Repository
-@Qualifier("GoodsDAO")
-public class GoodsDAOImpl implements GoodsDAO {
-
- // private DataSource dataSource;
-
- // private JdbcTemplate jdbcTemplate = new JdbcTemplate();
-
- /**
- * configuring a jdbc template
- */
- @Autowired
- private JdbcTemplate jdbcTemplate;
-
- /*public void setJdbcTemplate1(final JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }*/
-
- @Override
- public int addGoods(int goodsId, String goodsName, int goodsQuantity,
- double goodsPrice) {
- String query = "insert into goods values(" + goodsId + "," + "'" + goodsName + "'" + "," + goodsQuantity+ ","
- + goodsPrice + ")";
- System.out.println(query);
-
- return jdbcTemplate.update(query);
- }
-
- @Override
- public int updateGoods(int goodsId, String goodsName) {
- String query = "update goods set goodsName=" + "'" + goodsName + "'" + " where goodsId=" + goodsId;
- // String query = "update customer set customerName="+name+" where customerId="+
- // customerID;
-
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-
- @Override
- public int removeGoods(int goodsId) {
-
- String query = "delete from goods where goodsId=" + goodsId;
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-
- /*public JdbcTemplate getJdbcTemplate() {
- return jdbcTemplate;
- }
-
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }*/
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/repository/RetailerDAO.java b/11SpringBootUsingJDBC/src/main/java/repository/RetailerDAO.java
deleted file mode 100644
index 5e3aeed7..00000000
--- a/11SpringBootUsingJDBC/src/main/java/repository/RetailerDAO.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- *
- */
-package repository;
-
-import java.util.List;
-
-import model.Customer;
-import model.Goods;
-import model.Supplier;
-
-/**
- * @author trainee
- *
- */
-public interface RetailerDAO {
-
-
- int addRetailer(Supplier s);
-
-public List viewGoods();
-
-public List viewCustomer(int customerId );
-
-public List viewSupplier(int supplierId);
-
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/repository/RetailerDAOImpl.java b/11SpringBootUsingJDBC/src/main/java/repository/RetailerDAOImpl.java
deleted file mode 100644
index f8dfb848..00000000
--- a/11SpringBootUsingJDBC/src/main/java/repository/RetailerDAOImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- *
- */
-package repository;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.BeanPropertyRowMapper;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-import model.Customer;
-import model.Goods;
-import model.Supplier;
-
-/**
- * @author trainee
- *
- */
-
-@Repository
-public class RetailerDAOImpl implements RetailerDAO {
-
- @Autowired
- private JdbcTemplate jdbcTemplate;
-
- /*
- * @Override public int viewGoods() { // TODO Auto-generated method stub String
- * query = "select * from goods"; System.out.println(query); return
- * jdbcTemplate.update(query);
- *
- * }
- */
-
-
- @Override
- public List viewCustomer(final int customerId) {
- // TODO Auto-generated method stub
- List list = (List) jdbcTemplate.query(
- "SELECT * FROM customer where customerId = '" + customerId + "' ",
- new BeanPropertyRowMapper(Customer.class));
- System.out.println("In cust view");
- return list;
- }
-
-
- @Override
- public List viewSupplier(final int supplierId) {
- // TODO Auto-generated method stub
- List list = (List) jdbcTemplate.query(
- "SELECT * FROM supplier where supplierID = '" + supplierId + "' ",
- new BeanPropertyRowMapper(Supplier.class));
- System.out.println("In supplier view");
- return list;
- }
-
-
- public List viewGoods() {
- // TODO Auto-generated method stub
- List list = (List) jdbcTemplate.query(
- "SELECT * FROM goods",
- new BeanPropertyRowMapper(Goods.class));
- System.out.println("In goods view");
- return list;
- }
-
- @Override
- public int addRetailer(Supplier s) {
-
- String query = "insert into retailer values (" + "'" + s.getSupplierName() + "'" + "," + "'"
- + s.getSupplierAddress() + "'" + ")";
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/repository/SupplierDAO.java b/11SpringBootUsingJDBC/src/main/java/repository/SupplierDAO.java
deleted file mode 100644
index 3adab528..00000000
--- a/11SpringBootUsingJDBC/src/main/java/repository/SupplierDAO.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package repository;
-
-public interface SupplierDAO {
-
- public int addSupplier(int supplierId, String supplierName,
- String supplierAddress, int quantityOrder, int orderId,
- double amount);
-
- public int removeSupplier(int supplierId);
-
- public int updateSupplier(int supplierId, String supplierName);
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/repository/SupplierDAOImpl.java b/11SpringBootUsingJDBC/src/main/java/repository/SupplierDAOImpl.java
deleted file mode 100644
index f9236a7a..00000000
--- a/11SpringBootUsingJDBC/src/main/java/repository/SupplierDAOImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package repository;
-
-import javax.sql.DataSource;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-
-@Repository
-@Qualifier("supplierDAO")
-public class SupplierDAOImpl implements SupplierDAO {
-
- private DataSource dataSource;
-@Autowired
-JdbcTemplate jdbcTemplate;
-
-
-
-
-
-
- @Override
- public int addSupplier(final int supplierId, final String supplierName, final String supplierAddress, final int quantityOrder, final int orderId,
- final double amount) {
- String Query = "insert into supplier values(" + supplierId + "," + "'" + supplierName + "'" + "," + "'"
- + supplierAddress + "'" + "," + quantityOrder + "," + orderId + "," + amount + ")";
- System.out.println(Query);
- return jdbcTemplate.update(Query);
- }
-
- @Override
- public int removeSupplier(int supplierId) {
-
- String query = "delete from supplier where supplierId=" + supplierId;
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-
-
- @Override
- public int updateSupplier(int supplierId, String supplierName) {
-
- String query = "update supplier set supplierName="+"'" +supplierName+"'"+ "where supplierId="+supplierId;
-
- System.out.println(query);
- return jdbcTemplate.update(query);
- }
-/*
- *//**
- * @return the jdbcTemplate
- *//*
- public JdbcTemplate getJdbcTemplate() {
- return jdbcTemplate;
- }
-
- *//**
- * @param jdbcTemplate
- * the jdbcTemplate to set
- *//*
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }*/
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/service/CustomerService.java b/11SpringBootUsingJDBC/src/main/java/service/CustomerService.java
deleted file mode 100644
index fffc1be3..00000000
--- a/11SpringBootUsingJDBC/src/main/java/service/CustomerService.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package service;
-
-import model.Customer;
-
-public interface CustomerService {
-
-
- //public String addCustomer(Customer e);
-// public String updateCustomer(int customerID, String name);
- //public int removeCustomer(int id);
- int addCustomer(Customer c);
- int updateCustomer(int customerId, String customerName);
- int removeCusotmer(int customerId);
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/service/CustomerServiceImpl.java b/11SpringBootUsingJDBC/src/main/java/service/CustomerServiceImpl.java
deleted file mode 100644
index 08932ccc..00000000
--- a/11SpringBootUsingJDBC/src/main/java/service/CustomerServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package service;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import model.Customer;
-import repository.CustomerDAO;
-
-/**
- * @author Ram
- */
-@Service("customerService")
-public class CustomerServiceImpl implements CustomerService {
-
- @Autowired
- private CustomerDAO customerDAO;
-
- /**
- * @param customerDAO
- */
- public CustomerServiceImpl(final CustomerDAO customerDAO) {
- super();
- this.customerDAO = customerDAO;
- }
-
-
-
- public int addCustomer(final Customer c) {
- final int addData = customerDAO.addCustomer(c);
- return addData;
- }
-
- public int updateCustomer(int customerId, String customerName) {
- int updateData = customerDAO.updateCustomer(customerId, customerName);
- return updateData;
- }
-
- @Override
- public int removeCusotmer(int customerId) {
- int removeData = customerDAO.removeCustomer(customerId);
- return removeData;
- }
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/service/GoodsService.java b/11SpringBootUsingJDBC/src/main/java/service/GoodsService.java
deleted file mode 100644
index 345474c1..00000000
--- a/11SpringBootUsingJDBC/src/main/java/service/GoodsService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package service;
-
-import model.Goods;
-
-public interface GoodsService {
-
- /**
- * @method this method is calling a Repository Goods which connect to database
- * table Goods and adding goodsID, name,quantity,price
- *
- */
- int addGoods(int goodsId, String goodsName, int goodsQuantity,
- double goodsPrice);
-
- /**
- * @method this method is calling a Repository Goods which connect to database
- * table Goods and removing a perticular Goods from table
- *
- */
- int removeGoods(int goodsId);
-
- /**
- * @method this method is calling a Repository Goods which connect to database
- * table Goods and updating a perticular Goods
- *
- */
- int updateGoods(int goodsId, String goodsName);
- // public String orderGoods(int goodsId);
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/service/GoodsServiceImpl.java b/11SpringBootUsingJDBC/src/main/java/service/GoodsServiceImpl.java
deleted file mode 100644
index bd8049c7..00000000
--- a/11SpringBootUsingJDBC/src/main/java/service/GoodsServiceImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package service;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import model.Goods;
-import repository.GoodsDAO;
-
-@Service("goodsService")
-public class GoodsServiceImpl implements GoodsService {
-
-
- @Autowired
- private GoodsDAO goodsdao;
-
- public GoodsServiceImpl(final GoodsDAO goodsdao) {
- super();
- this.goodsdao = goodsdao;
- }
-
- @Override
- public int addGoods(int goodsId, String goodsName, int goodsQuantity,
- double goodsPrice) {
-
- int addData = goodsdao.addGoods(goodsId,goodsName,goodsQuantity,goodsPrice);
- return addData;
- }
-
- @Override
- public int removeGoods(int goodsId) {
- // GoodsDAO goodsDAO = null;
- int remmoveData = goodsdao.removeGoods(goodsId);
- return remmoveData;
- }
-
- @Override
- public int updateGoods(int goodsId, String goodsName) {
- // GoodsDAO goodsDAO = null;
- int updateData = goodsdao.updateGoods(goodsId, goodsName);
- return updateData;
- }
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/service/RetailerService.java b/11SpringBootUsingJDBC/src/main/java/service/RetailerService.java
deleted file mode 100644
index 536690d0..00000000
--- a/11SpringBootUsingJDBC/src/main/java/service/RetailerService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- *
- */
-package service;
-
-import java.util.List;
-
-import model.Customer;
-import model.Goods;
-import model.Supplier;
-
-/**
- * @author trainee
- *
- */
-public interface RetailerService {
-
- //int addSupplier(String supplierName, String supplierAddress);
-
- int addRetailer(Supplier s);
-
-
-public List viewGoods();
-
-public List viewCustomer(int customerId );
-
-public List viewSupplier(int supplierId);
-
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/service/RetailerServiceImpl.java b/11SpringBootUsingJDBC/src/main/java/service/RetailerServiceImpl.java
deleted file mode 100644
index 0dd0c4a1..00000000
--- a/11SpringBootUsingJDBC/src/main/java/service/RetailerServiceImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- *
- */
-package service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import model.Customer;
-import model.Goods;
-import model.Supplier;
-import repository.CustomerDAO;
-import repository.RetailerDAO;
-import repository.RetailerDAOImpl;
-
-/**
- * @author trainee
- *
- */
-@Service
-public class RetailerServiceImpl implements RetailerService {
-
- @Autowired
- private RetailerDAO retailerDao;
-
- @Override
- public int addRetailer(final Supplier s) {
-
- return retailerDao.addRetailer(s);
-
- }
-
- public List viewCustomer(int customerId ) {
- List customerList = new ArrayList();
- customerList = retailerDao.viewCustomer(customerId);
- return customerList;
- }
-
- @Override
- public List viewSupplier(final int supplierId) {
- // TODO Auto-generated method stub
- return retailerDao.viewSupplier(supplierId);
- }
-
- @Override
- public List viewGoods() {
- // TODO Auto-generated method stub
- return retailerDao.viewGoods();
- }
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/service/SupplierService.java b/11SpringBootUsingJDBC/src/main/java/service/SupplierService.java
deleted file mode 100644
index b230abd2..00000000
--- a/11SpringBootUsingJDBC/src/main/java/service/SupplierService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package service;
-
-/**
- * this interface contains various operations.
- */
-public interface SupplierService {
-
- /**
- * this method is used to invoke the Repository method addSupplier
- * which will hit the databases.
- *
- */
- int addSupplier(int supplierId, String supplierName,
- String supplierAddress, int quantityOrder, int orderId,
- double amount);
- /**
- * this method is used to invoke the Repository method removeSupplier
- * which will hit the databases.
- *
- */
- int removeSupplier(int supplierId);
-
- /**
- * this method is used to invoke the Repository method addSupplier
- * which will hit the databases.
- *
- */
- int updateSupplier(int supplierId,String supplierName);
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/java/service/SupplierServiceImpl.java b/11SpringBootUsingJDBC/src/main/java/service/SupplierServiceImpl.java
deleted file mode 100644
index 1ea11f11..00000000
--- a/11SpringBootUsingJDBC/src/main/java/service/SupplierServiceImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package service;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import repository.SupplierDAO;
-
-/**
- * this class implementing methods of its parent interface
- */
-
-@Service("supplierService")
-public class SupplierServiceImpl implements SupplierService {
-
- /**
- * @param supplierDAO
- * this will be used to access DAO methods
- */
- @Autowired
- private SupplierDAO supplierDAO;
-
- /**
- * @param supplierDAO
- */
-
- @Override
- public int addSupplier(final int supplierId, final String supplierName, final String supplierAddress,
- final int quantityOrder, final int orderId, final double amount) {
-
- // SupplierDAO supplierDAO = null;
- final int addData = supplierDAO.addSupplier(supplierId, supplierName, supplierAddress, quantityOrder, orderId,
- amount);
- return addData;
-
- }
-
- @Override
- public int removeSupplier(final int supplierId) {
- // final SupplierDAO supplierDAO = null;
- final int removeData = supplierDAO.removeSupplier(supplierId);
- return removeData;
- }
-
- @Override
- public int updateSupplier(final int supplierId, final String supplierName) {
- final SupplierDAO supplierDAO = null;
- int removeData = supplierDAO.updateSupplier(supplierId, supplierName);
- return removeData;
- }
-
-}
diff --git a/11SpringBootUsingJDBC/src/main/resources/application.properties b/11SpringBootUsingJDBC/src/main/resources/application.properties
deleted file mode 100644
index e69de29b..00000000
diff --git a/11SpringBootUsingJDBC/src/main/resources/database.properties b/11SpringBootUsingJDBC/src/main/resources/database.properties
deleted file mode 100644
index 9c1f900e..00000000
--- a/11SpringBootUsingJDBC/src/main/resources/database.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-driver=com.mysql.jdbc.Driver
-url=jdbc:mysql://localhost:3306/mydb1
-dbuser=root
-dbpassword=root
\ No newline at end of file
diff --git a/11SpringBootUsingJDBC/src/test/java/com/example/demo/DemoApplicationTests.java b/11SpringBootUsingJDBC/src/test/java/com/example/demo/DemoApplicationTests.java
deleted file mode 100644
index b76e7f2e..00000000
--- a/11SpringBootUsingJDBC/src/test/java/com/example/demo/DemoApplicationTests.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.example.demo;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class DemoApplicationTests {
-
- @Test
- public void contextLoads() {
- }
-
-}
diff --git a/12SpringBoot&JPA/.gitignore b/12SpringBoot&JPA/.gitignore
deleted file mode 100644
index 82eca336..00000000
--- a/12SpringBoot&JPA/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/build/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
\ No newline at end of file
diff --git a/12SpringBoot&JPA/.mvn/wrapper/maven-wrapper.jar b/12SpringBoot&JPA/.mvn/wrapper/maven-wrapper.jar
deleted file mode 100644
index 9cc84ea9..00000000
Binary files a/12SpringBoot&JPA/.mvn/wrapper/maven-wrapper.jar and /dev/null differ
diff --git a/12SpringBoot&JPA/.mvn/wrapper/maven-wrapper.properties b/12SpringBoot&JPA/.mvn/wrapper/maven-wrapper.properties
deleted file mode 100644
index b573bb50..00000000
--- a/12SpringBoot&JPA/.mvn/wrapper/maven-wrapper.properties
+++ /dev/null
@@ -1 +0,0 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
diff --git a/12SpringBoot&JPA/mvnw b/12SpringBoot&JPA/mvnw
deleted file mode 100644
index 5bf251c0..00000000
--- a/12SpringBoot&JPA/mvnw
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/12SpringBoot&JPA/mvnw.cmd b/12SpringBoot&JPA/mvnw.cmd
deleted file mode 100644
index 019bd74d..00000000
--- a/12SpringBoot&JPA/mvnw.cmd
+++ /dev/null
@@ -1,143 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/12SpringBoot&JPA/pom.xml b/12SpringBoot&JPA/pom.xml
deleted file mode 100644
index 71b792d4..00000000
--- a/12SpringBoot&JPA/pom.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
- 4.0.0
-
- com.consumer
- consumerSpringBoot
- 0.0.1-SNAPSHOT
- jar
-
- demo
- Consumer project for Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.1.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- com.h2database
- h2
- runtime
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
diff --git a/12SpringBoot&JPA/src/main/java/com/cg/ConsumerMain.java b/12SpringBoot&JPA/src/main/java/com/cg/ConsumerMain.java
deleted file mode 100644
index 19cc2e5c..00000000
--- a/12SpringBoot&JPA/src/main/java/com/cg/ConsumerMain.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.cg;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
-
- @ComponentScan(basePackages="com.cg")
- @SpringBootApplication
- public class ConsumerMain {
-
-
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- SpringApplication.run(ConsumerMain.class, args);
- }
-
-
-}
diff --git a/12SpringBoot&JPA/src/main/java/com/cg/controller/CustomerController.java b/12SpringBoot&JPA/src/main/java/com/cg/controller/CustomerController.java
deleted file mode 100644
index 0822c940..00000000
--- a/12SpringBoot&JPA/src/main/java/com/cg/controller/CustomerController.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.cg.controller;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.cg.model.Customer;
-import com.cg.service.ICustomerService;
-
-@RestController
-public class CustomerController {
-
- @Autowired
- ICustomerService customerService;
-
- @PostMapping("/customerCreate")
- public ResponseEntity createCustomer(@RequestBody final Customer customer)
- {
-
- Customer cust=customerService.addCustomer(customer);
- return new ResponseEntity(customer,HttpStatus.CREATED);
-
- }
-
-
-
-
-}
diff --git a/12SpringBoot&JPA/src/main/java/com/cg/dao/CustomerRepository.java b/12SpringBoot&JPA/src/main/java/com/cg/dao/CustomerRepository.java
deleted file mode 100644
index 43c4d518..00000000
--- a/12SpringBoot&JPA/src/main/java/com/cg/dao/CustomerRepository.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.cg.dao;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-import com.cg.model.Customer;
-
-@Repository
-public interface CustomerRepository extends JpaRepository{
-
- // List findByCustomerName(String customerName);
-
-}
diff --git a/12SpringBoot&JPA/src/main/java/com/cg/model/Customer.java b/12SpringBoot&JPA/src/main/java/com/cg/model/Customer.java
deleted file mode 100644
index c5f798b4..00000000
--- a/12SpringBoot&JPA/src/main/java/com/cg/model/Customer.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package com.cg.model;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.hibernate.annotations.GeneratorType;
-
-@Entity
-@Table(name="customer")
-public class Customer {
- @Id
- @GeneratedValue(strategy=GenerationType.AUTO)
- @Column(name="customer_id")
- public long customerId;
- @Column(name="customer_name")
- public String customerName;
- @Column(name="customer_address")
- public String customerAddress;
- @Column(name="payment_mode")
- public String paymentMode;
-
- /**
- * @return the customerId
- */
- public long getCustomerId() {
- return customerId;
- }
- /**
- * @param customerId the customerId to set
- */
- public void setCustomerId(long customerId) {
- this.customerId = customerId;
- }
- /**
- * @return the customerName
- */
- public String getCustomerName() {
- return customerName;
- }
- /**
- * @param customerName the customerName to set
- */
- public void setCustomerName(String customerName) {
- this.customerName = customerName;
- }
- /**
- * @return the customerAddress
- */
- public String getCustomerAddress() {
- return customerAddress;
- }
- /**
- * @param customerAddress the customerAddress to set
- */
- public void setCustomerAddress(String customerAddress) {
- this.customerAddress = customerAddress;
- }
- /**
- * @return the paymentMode
- */
- public String getPaymentMode() {
- return paymentMode;
- }
- /**
- * @param paymentMode the paymentMode to set
- */
- public void setPaymentMode(String paymentMode) {
- this.paymentMode = paymentMode;
- }
- /**
- * @return the retailerName
- */
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Customer [customerId=" + customerId + ", customerName=" + customerName + ", customerAddress="
- + customerAddress + ", paymentMode=" + paymentMode + "]";
- }
-
- public Customer() {
- // TODO Auto-generated constructor stub
- }
-
-}
diff --git a/12SpringBoot&JPA/src/main/java/com/cg/service/CustomerServiceImpl.java b/12SpringBoot&JPA/src/main/java/com/cg/service/CustomerServiceImpl.java
deleted file mode 100644
index fd909adc..00000000
--- a/12SpringBoot&JPA/src/main/java/com/cg/service/CustomerServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.cg.service;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.cg.dao.CustomerRepository;
-import com.cg.model.Customer;
-
-@Service("customerService")
-public class CustomerServiceImpl implements ICustomerService{
- @Autowired
- public CustomerRepository customerRepository;
-
- @Override
- public Customer AddCustomer(Customer customer) {
- // TODO Auto-generated method stub
- customerRepository.save(customer);
- return customer;
- }
-
- @Override
- public Customer DeleteCustomer(Customer customer) {
-
- customerRepository.delete(entity);
- return customer;
- }
-
-
-
-}
diff --git a/12SpringBoot&JPA/src/main/java/com/cg/service/ICustomerService.java b/12SpringBoot&JPA/src/main/java/com/cg/service/ICustomerService.java
deleted file mode 100644
index d4131cf4..00000000
--- a/12SpringBoot&JPA/src/main/java/com/cg/service/ICustomerService.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.cg.service;
-
-import com.cg.model.Customer;
-
-public interface ICustomerService {
-
- public Customer AddCustomer(Customer customer);
-
- public Customer DeleteCustomer(Customer customer);
-
-}
diff --git a/12SpringBoot&JPA/src/main/java/com/consumer/DemoApplication.java b/12SpringBoot&JPA/src/main/java/com/consumer/DemoApplication.java
deleted file mode 100644
index 591a05d5..00000000
--- a/12SpringBoot&JPA/src/main/java/com/consumer/DemoApplication.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.consumer;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class DemoApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(DemoApplication.class, args);
- }
-}
diff --git a/12SpringBoot&JPA/src/main/resources/application.properties b/12SpringBoot&JPA/src/main/resources/application.properties
deleted file mode 100644
index de2a7aa5..00000000
--- a/12SpringBoot&JPA/src/main/resources/application.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-spring.jpa.show-sql=true
-spring.jpa.hibernate.ddl-auto=update
-# Enabling H2 Console
-spring.h2.console.enabled=true
-#this will persist data in next run
-spring.datasource.url=jdbc:h2:~/test;DB_CLOSE_ON_EXIT=FALSE
\ No newline at end of file
diff --git a/12SpringBoot&JPA/src/test/java/com/consumer/DemoApplicationTests.java b/12SpringBoot&JPA/src/test/java/com/consumer/DemoApplicationTests.java
deleted file mode 100644
index fb255fed..00000000
--- a/12SpringBoot&JPA/src/test/java/com/consumer/DemoApplicationTests.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.consumer;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class DemoApplicationTests {
-
- @Test
- public void contextLoads() {
- }
-
-}
diff --git a/13SpringBootJPA(REMOVEADD)/.gitignore b/13SpringBootJPA(REMOVEADD)/.gitignore
deleted file mode 100644
index 82eca336..00000000
--- a/13SpringBootJPA(REMOVEADD)/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/build/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
\ No newline at end of file
diff --git a/13SpringBootJPA(REMOVEADD)/.mvn/wrapper/maven-wrapper.jar b/13SpringBootJPA(REMOVEADD)/.mvn/wrapper/maven-wrapper.jar
deleted file mode 100644
index 9cc84ea9..00000000
Binary files a/13SpringBootJPA(REMOVEADD)/.mvn/wrapper/maven-wrapper.jar and /dev/null differ
diff --git a/13SpringBootJPA(REMOVEADD)/.mvn/wrapper/maven-wrapper.properties b/13SpringBootJPA(REMOVEADD)/.mvn/wrapper/maven-wrapper.properties
deleted file mode 100644
index b573bb50..00000000
--- a/13SpringBootJPA(REMOVEADD)/.mvn/wrapper/maven-wrapper.properties
+++ /dev/null
@@ -1 +0,0 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
diff --git a/13SpringBootJPA(REMOVEADD)/mvnw b/13SpringBootJPA(REMOVEADD)/mvnw
deleted file mode 100644
index 5bf251c0..00000000
--- a/13SpringBootJPA(REMOVEADD)/mvnw
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/13SpringBootJPA(REMOVEADD)/mvnw.cmd b/13SpringBootJPA(REMOVEADD)/mvnw.cmd
deleted file mode 100644
index 019bd74d..00000000
--- a/13SpringBootJPA(REMOVEADD)/mvnw.cmd
+++ /dev/null
@@ -1,143 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/13SpringBootJPA(REMOVEADD)/pom.xml b/13SpringBootJPA(REMOVEADD)/pom.xml
deleted file mode 100644
index 71b792d4..00000000
--- a/13SpringBootJPA(REMOVEADD)/pom.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
- 4.0.0
-
- com.consumer
- consumerSpringBoot
- 0.0.1-SNAPSHOT
- jar
-
- demo
- Consumer project for Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.1.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- com.h2database
- h2
- runtime
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
diff --git a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/ConsumerMain.java b/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/ConsumerMain.java
deleted file mode 100644
index 639966d0..00000000
--- a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/ConsumerMain.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.cg;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
-
-
- @SpringBootApplication
- public class ConsumerMain {
-
-
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- SpringApplication.run(ConsumerMain.class, args);
- }
-
-
-
-
-
-
-
-
-
-}
diff --git a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/controller/CustomerController.java b/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/controller/CustomerController.java
deleted file mode 100644
index 3f1373cc..00000000
--- a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/controller/CustomerController.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package com.cg.controller;
-
-import java.util.Iterator;
-import java.util.List;
-
-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.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.cg.dao.CustomerRepository;
-import com.cg.model.Customer;
-import com.cg.service.ICustomerService;
-
-@RestController
-@RequestMapping("/api")
-public class CustomerController {
-
- @Autowired
- ICustomerService customerService;
-
- // -------------------Create a User-------------------------------------------
-
- @RequestMapping(value = "/addNewCustomer", method = RequestMethod.GET)
- public Customer NewUser() {
-
- Customer c = new Customer("hulk", "newyork", "Debit");
- customerService.saveUser(c);
-
- return null;
-
- }
-
- /*@RequestMapping(value = "/user/{id}", method = RequestMethod.GET)
- public ResponseEntity> deleteUser(@PathVariable("id") long id) {
- // System.out.printf("Fetching & Deleting User with id {}", id);
-
- Customer user = customerService.findById(id);
- // if (user == null) {
- // System.out.printf("Unable to delete. User with id {} not found.", id);
- // return new ResponseEntity(new CustomErrorType("Unable to delete. User with id
- // " + id + " not found."),
- // HttpStatus.NOT_FOUND);
-
- customerService.deleteUserById(id);
- // return new ResponseEntity(HttpStatus.NO_CONTENT);
- return null;
- }*/
-
- @RequestMapping(value = "/user/{id}", method = RequestMethod.GET)
- public void findAll(@PathVariable("id") long id)
- {
-
- customerService.findAll(id);
-
-
- }
-
- /*
- * @PostMapping("/customerCreate") public ResponseEntity
- * createCustomer(@RequestBody final Customer customer) {
- *
- * Customer cust=customerService.addCustomer(customer); return new
- * ResponseEntity(customer,HttpStatus.CREATED);
- *
- * }
- *
- */
-
- // -------------------Retrieve All
- // Users---------------------------------------------
-
- /*
- * @RequestMapping(value = "/user/", method = RequestMethod.GET) public
- * ResponseEntity> listAllUsers() { List users =
- * customerService.findAllUsers(); if (users.isEmpty()) { return new
- * ResponseEntity(HttpStatus.NO_CONTENT); // You many decide to return
- * HttpStatus.NOT_FOUND } return new ResponseEntity>(users,
- * HttpStatus.OK); }
- *
- * // -------------------Retrieve Single //
- * User------------------------------------------
- *
- * @RequestMapping(value = "/user/{id}", method = RequestMethod.GET) public
- * ResponseEntity> getUser(@PathVariable("id") long id) {
- * System.out.printf("Fetching User with id {}", id); Customer user =
- * customerService.findById(id); if (user == null) {
- * System.out.printf("User with id {} not found.", id); return new
- * ResponseEntity(new CustomErrorType("User with id " + id + " not found"),
- * HttpStatus.NOT_FOUND); } return new ResponseEntity(user,
- * HttpStatus.OK); }
- */
-
- /*
- * // ------------------- Update a User //
- * ------------------------------------------------
- *
- * @RequestMapping(value = "/user/{id}", method = RequestMethod.PUT) public
- * ResponseEntity> updateUser(@PathVariable("id") long id, @RequestBody
- * Customer user) { System.out.printf("Updating User with id {}", id);
- *
- * Customer currentUser = customerService.findById(id);
- *
- * if (currentUser == null) {
- * System.out.printf("Unable to update. User with id {} not found.", id); return
- * new ResponseEntity(new CustomErrorType("Unable to upate. User with id " + id
- * + " not found."), HttpStatus.NOT_FOUND); }
- *
- * currentUser.setCustomerName(user.getCustomerName());
- * currentUser.setCustomerAddress(user.getCustomerAddress());
- * currentUser.setPaymentMode(user.getPaymentMode());
- *
- * customerService.updateUser(currentUser); return new
- * ResponseEntity(currentUser, HttpStatus.OK); }
- *
- * // ------------------- Delete a User-----------------------------------------
- *
- * @RequestMapping(value = "/user/{id}", method = RequestMethod.DELETE) public
- * ResponseEntity> deleteUser(@PathVariable("id") long id) {
- * System.out.printf("Fetching & Deleting User with id {}", id);
- *
- * Customer user = customerService.findById(id); if (user == null) {
- * System.out.printf("Unable to delete. User with id {} not found.", id); return
- * new ResponseEntity(new CustomErrorType("Unable to delete. User with id " + id
- * + " not found."), HttpStatus.NOT_FOUND); }
- * customerService.deleteUserById(id); return new
- * ResponseEntity(HttpStatus.NO_CONTENT); }
- *
- * // ------------------- Delete All Users-----------------------------
- *
- * @RequestMapping(value = "/user/", method = RequestMethod.DELETE) public
- * ResponseEntity deleteAllUsers() {
- * System.out.printf("Deleting All Users");
- *
- * customerService.deleteAllUsers(); return new
- * ResponseEntity(HttpStatus.NO_CONTENT); }
- */
-
-}
diff --git a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/dao/CustomerRepository.java b/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/dao/CustomerRepository.java
deleted file mode 100644
index 43c4d518..00000000
--- a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/dao/CustomerRepository.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.cg.dao;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-import com.cg.model.Customer;
-
-@Repository
-public interface CustomerRepository extends JpaRepository{
-
- // List findByCustomerName(String customerName);
-
-}
diff --git a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/model/Customer.java b/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/model/Customer.java
deleted file mode 100644
index 8edca130..00000000
--- a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/model/Customer.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package com.cg.model;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.hibernate.annotations.GeneratorType;
-
-@Entity
-@Table(name="customer")
-public class Customer {
- @Id
- @GeneratedValue(strategy=GenerationType.AUTO)
- @Column(name="customer_id")
- public long customerId;
- @Column(name="customer_name")
- public String customerName;
- @Column(name="customer_address")
- public String customerAddress;
- @Column(name="payment_mode")
- public String paymentMode;
-
-
-
-
-
-
- /**
- * @param customerName
- * @param customerAddress
- * @param paymentMode
- */
- public Customer(String customerName, String customerAddress, String paymentMode) {
- super();
- this.customerName = customerName;
- this.customerAddress = customerAddress;
- this.paymentMode = paymentMode;
- }
- /**
- * @return the customerId
- */
- public long getCustomerId() {
- return customerId;
- }
- /**
- * @param customerId the customerId to set
- */
- public void setCustomerId(long customerId) {
- this.customerId = customerId;
- }
- /**
- * @return the customerName
- */
- public String getCustomerName() {
- return customerName;
- }
- /**
- * @param customerName the customerName to set
- */
- public void setCustomerName(String customerName) {
- this.customerName = customerName;
- }
- /**
- * @return the customerAddress
- */
- public String getCustomerAddress() {
- return customerAddress;
- }
- /**
- * @param customerAddress the customerAddress to set
- */
- public void setCustomerAddress(String customerAddress) {
- this.customerAddress = customerAddress;
- }
- /**
- * @return the paymentMode
- */
- public String getPaymentMode() {
- return paymentMode;
- }
- /**
- * @param paymentMode the paymentMode to set
- */
- public void setPaymentMode(String paymentMode) {
- this.paymentMode = paymentMode;
- }
- /**
- * @return the retailerName
- */
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Customer [customerId=" + customerId + ", customerName=" + customerName + ", customerAddress="
- + customerAddress + ", paymentMode=" + paymentMode + "]";
- }
-
- public Customer() {
- // TODO Auto-generated constructor stub
- }
-
-}
diff --git a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/service/CustomerServiceImpl.java b/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/service/CustomerServiceImpl.java
deleted file mode 100644
index 2b649baa..00000000
--- a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/service/CustomerServiceImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.cg.service;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.cg.dao.CustomerRepository;
-import com.cg.model.Customer;
-
-@Service("customerService")
-public class CustomerServiceImpl implements ICustomerService{
-
-
- @Autowired
- public CustomerRepository customerRepository;
-
- public List findAll(long id) {
- // CustomerRepository customerRepo = null;
- List customerList = customerRepository.findAll();
- Iterator iterator = customerList.iterator();
- while(iterator.hasNext())
- {
- Customer customer = (Customer) iterator.next();
- if(customer.getCustomerId() == id)
- {
- customerRepository.deleteById(id);
- }
- }
- return customerList;
- }
-
- /*
- public Customer findById(long id) {
- for(Customer user : users){
- if(user.getCustomerId() == id){
- return user;
- }
- }
- return null;
- }*/
-
- @Override
- public void saveUser(Customer user) {
-
-
- }
-
-//public void deleteUserById(long id) {
-//
-// for (Iterator iterator = users.iterator(); iterator.hasNext(); ) {
-// Customer user = iterator.next();
-// if (user.getCustomerId() == id) {
-// iterator.remove();
-// }
-// }
-// }
-//
-//
-
-
-
- /*
-
- @Override
- public Customer AddCustomer(Customer customer) {
- // TODO Auto-generated method stub
- customerRepository.save(customer);
- return customer;
- }*/
-
-
-
-
-}
diff --git a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/service/ICustomerService.java b/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/service/ICustomerService.java
deleted file mode 100644
index 7541e08f..00000000
--- a/13SpringBootJPA(REMOVEADD)/src/main/java/com/cg/service/ICustomerService.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.cg.service;
-
-import java.util.List;
-
-import com.cg.model.Customer;
-
-public interface ICustomerService {
-
- //public Customer AddCustomer(Customer customer);
-
-//Customer findById(long id);
- public List findAll(long id);
-/*Customer findByName(String name);*/
-
- void saveUser(Customer user);
- //void deleteUserById(long id);
- /*void updateUser(Customer user);
-
-
-
- List findAllUsers();
-
- void deleteAllUsers();
-
- boolean isUserExist(Customer user);*/
-
-}
diff --git a/13SpringBootJPA(REMOVEADD)/src/main/java/com/consumer/DemoApplication.java b/13SpringBootJPA(REMOVEADD)/src/main/java/com/consumer/DemoApplication.java
deleted file mode 100644
index 591a05d5..00000000
--- a/13SpringBootJPA(REMOVEADD)/src/main/java/com/consumer/DemoApplication.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.consumer;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class DemoApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(DemoApplication.class, args);
- }
-}
diff --git a/13SpringBootJPA(REMOVEADD)/src/main/java/springboot/util/CustomErrorType.java b/13SpringBootJPA(REMOVEADD)/src/main/java/springboot/util/CustomErrorType.java
deleted file mode 100644
index a506e30e..00000000
--- a/13SpringBootJPA(REMOVEADD)/src/main/java/springboot/util/CustomErrorType.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package springboot.util;
-
-
-public class CustomErrorType {
-
- private String errorMessage;
-
- public CustomErrorType(String errorMessage){
- this.errorMessage = errorMessage;
- }
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
-}
diff --git a/13SpringBootJPA(REMOVEADD)/src/main/resources/application.properties b/13SpringBootJPA(REMOVEADD)/src/main/resources/application.properties
deleted file mode 100644
index de2a7aa5..00000000
--- a/13SpringBootJPA(REMOVEADD)/src/main/resources/application.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-spring.jpa.show-sql=true
-spring.jpa.hibernate.ddl-auto=update
-# Enabling H2 Console
-spring.h2.console.enabled=true
-#this will persist data in next run
-spring.datasource.url=jdbc:h2:~/test;DB_CLOSE_ON_EXIT=FALSE
\ No newline at end of file
diff --git a/13SpringBootJPA(REMOVEADD)/src/test/java/com/consumer/DemoApplicationTests.java b/13SpringBootJPA(REMOVEADD)/src/test/java/com/consumer/DemoApplicationTests.java
deleted file mode 100644
index fb255fed..00000000
--- a/13SpringBootJPA(REMOVEADD)/src/test/java/com/consumer/DemoApplicationTests.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.consumer;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class DemoApplicationTests {
-
- @Test
- public void contextLoads() {
- }
-
-}
diff --git a/14SpringBootJPAmysql/.gitignore b/14SpringBootJPAmysql/.gitignore
deleted file mode 100644
index 82eca336..00000000
--- a/14SpringBootJPAmysql/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/build/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
\ No newline at end of file
diff --git a/14SpringBootJPAmysql/.mvn/wrapper/maven-wrapper.jar b/14SpringBootJPAmysql/.mvn/wrapper/maven-wrapper.jar
deleted file mode 100644
index 9cc84ea9..00000000
Binary files a/14SpringBootJPAmysql/.mvn/wrapper/maven-wrapper.jar and /dev/null differ
diff --git a/14SpringBootJPAmysql/.mvn/wrapper/maven-wrapper.properties b/14SpringBootJPAmysql/.mvn/wrapper/maven-wrapper.properties
deleted file mode 100644
index b573bb50..00000000
--- a/14SpringBootJPAmysql/.mvn/wrapper/maven-wrapper.properties
+++ /dev/null
@@ -1 +0,0 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
diff --git a/14SpringBootJPAmysql/mvnw b/14SpringBootJPAmysql/mvnw
deleted file mode 100644
index 5bf251c0..00000000
--- a/14SpringBootJPAmysql/mvnw
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/14SpringBootJPAmysql/mvnw.cmd b/14SpringBootJPAmysql/mvnw.cmd
deleted file mode 100644
index 019bd74d..00000000
--- a/14SpringBootJPAmysql/mvnw.cmd
+++ /dev/null
@@ -1,143 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/14SpringBootJPAmysql/pom.xml b/14SpringBootJPAmysql/pom.xml
deleted file mode 100644
index 1f26f873..00000000
--- a/14SpringBootJPAmysql/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
- 4.0.0
-
- com.training
- springbootjpa
- 0.0.1-SNAPSHOT
- jar
-
- springbootjpa
- Demo project for Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.1.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- com.h2database
- h2
- runtime
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- org.mockito
- mockito-core
- 2.18.3
-
-
- org.mockito
- mockito-junit-jupiter
- 2.18.3
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/SpringbootjpaApplication.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/SpringbootjpaApplication.java
deleted file mode 100644
index 2608ef69..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/SpringbootjpaApplication.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.training.springbootjpa;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class SpringbootjpaApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(SpringbootjpaApplication.class, args);
- }
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/controller/MainController.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/controller/MainController.java
deleted file mode 100644
index c181353f..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/controller/MainController.java
+++ /dev/null
@@ -1,270 +0,0 @@
-package com.training.springbootjpa.controller;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.training.springbootjpa.exception.ManagedException;
-import com.training.springbootjpa.model.Customer;
-import com.training.springbootjpa.model.Goods;
-import com.training.springbootjpa.model.Retailer;
-import com.training.springbootjpa.model.Supplier;
-import com.training.springbootjpa.repository.CustomerDAO;
-import com.training.springbootjpa.service.CustomerService;
-import com.training.springbootjpa.service.GoodsService;
-import com.training.springbootjpa.service.RetailerService;
-import com.training.springbootjpa.service.SupplierService;
-
-@RestController
-public class MainController {
-
-
-
- private static final Logger LOGGER = Logger.getLogger( MainController.class.getName() );
- /*
- * with help of this annonation we can access all the proporties of bean we can
- * access all method of CustomerService.
- */
- @Autowired
- private CustomerService customerService;
-
- @Autowired
- private GoodsService goodsService;
-
- @Autowired
- private SupplierService supplierService;
-
- @Autowired
- private RetailerService retailerService;
-
- @Autowired
- CustomerDAO cdao;
-
- /*
- * Get Customer Details using Id Handling the exception using Custom Exception
- */
- @RequestMapping(value = "/customer/{id}", method = RequestMethod.GET)
- public ResponseEntity getCustomerById(@PathVariable Long id) throws ManagedException {
- LOGGER.info("Inside Get Customer By Id");
- String customer = null;
-
- try {
- customer = customerService.getCustomerDetail(id);
- } catch (ManagedException e) {
-
- e.getMessage();
- }
- System.out.println(customer);
-
- return new ResponseEntity(customer, HttpStatus.OK);
- }
-
- // Get Customer Details using Name
- // Handling the exception
- /*
- * Also we can send your whole Customer Details to UI using
- * ResponseEntity For now this method is just telling user that your
- * data is being get added succesfully.
- *
- */
-
- @RequestMapping(method = RequestMethod.GET, value = "/searchCustomer/{customerName}")
-
- public ResponseEntity searchCustomer(@PathVariable String customerName) throws ManagedException {
- LOGGER.info("Inside Get Customer By Name");
-
- Customer customerData = null;
-
- customerData = cdao.findByCustomerName(customerName);
- if (customerData == null)
- return new ResponseEntity("Data not found", HttpStatus.OK);
- else
- return new ResponseEntity("Data found", (MultiValueMap) customerData, HttpStatus.OK);
-
- }
-
- /*this method shows all customers to admin if requested
- */
-
- @RequestMapping(method = RequestMethod.GET, value = "/getAllCustomer")
- // @PostMapping(path = "/addCustomer")
- public ResponseEntity> getAllCustomer() {
- LOGGER.info("Inside Get All Customers ");
- final List customerData;
-
- customerData = customerService.getCustomer();
-
- return new ResponseEntity(customerData, HttpStatus.OK);
- }
-
-
- /*
- * This method add new customer to database
- * Exception Handling- if users provides Null to Textbox then it will throw Proper Message to user .
- */
- @RequestMapping(method = RequestMethod.POST, value = "/addCustomer", produces = MediaType.APPLICATION_JSON_VALUE)
- // @PostMapping(path = "/addCustomer")
- public ResponseEntity createCustomer(@RequestBody Customer customer) {
-
- LOGGER.info("Inside Add New Customer ");
- Customer customerData = null;
-
- try {
- customerData = customerService.addCustomer(customer);
- return new ResponseEntity(customerData, HttpStatus.OK);
-
- } catch (ManagedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- return new ResponseEntity("Provide valid input", HttpStatus.OK);
- }
-
-
- }
-
-
-
-
-
- /**
- * GET /delete Delete a customer details from the database.
- *
- *
- */
- @RequestMapping("/delete/{customerId}")
- public ResponseEntity deleteCustomerRecord(@PathVariable Long customerId) {
-
- Customer cust =null;
- LOGGER.info("Inside Delete Customer ");
- try {
- cust = customerService.deleteCustomerById(customerId);
- } catch (ManagedException e) {
-
-
- e.printStackTrace();
- return new ResponseEntity("Given Id not found", HttpStatus.OK);
- }
-
- return new ResponseEntity("Given Id deleted successfully ", HttpStatus.OK);
- }
-
-
- /**
- *
- * Another Implementation
- * GET /delete Delete a customer details from the database.
- *
- *
- */
-
-
-/**
- * GET /delete Delete a booking from the database.
- */
- @RequestMapping("/delete/{customerId}")
- public String deletecustomer(@PathVariable Long customerId) {
-
- LOGGER.info("Inside Delete Customer ");
- try {
- customerService.deleteCustomerById(customerId);
- } catch (ManagedException e) {
-
-
- e.printStackTrace();
- return "CustomerID #"+customerId+" Not Found";
- }
-
- return "CustomerID #"+customerId+" deleted successfully";
- }
-
-
-
-
-
-
-
- @RequestMapping(value = "/updateCustomer/{updateById}", method = RequestMethod.GET)
- public ResponseEntity updateCustomer(@PathVariable("updateById") long updateById) {
- final Customer customer = customerService.updateCustomerById(updateById);
- return new ResponseEntity(customer, HttpStatus.OK);
- }
-
- @RequestMapping(method = RequestMethod.POST, value = "/addGoods", produces = MediaType.APPLICATION_JSON_VALUE)
- ResponseEntity createGoods(@RequestBody Goods goods) {
- System.out.println(goods);
- final Goods goodsData;
- goodsData = goodsService.addGoods(goods);
- return new ResponseEntity(goodsData, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/deleteGoods/{deleteById}", method = RequestMethod.GET)
- public ResponseEntity deleteGoods(@PathVariable("deleteById") long deleteById) {
- final List goodsList;
- goodsList = goodsService.deleteGoodsById(deleteById);
- return new ResponseEntity(goodsList, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/updateGoods/{updateById}", method = RequestMethod.GET)
- public ResponseEntity updateGoods(@PathVariable("updateById") long updateById) {
- final Goods goods = goodsService.updateGoodsById(updateById);
- return new ResponseEntity(goods, HttpStatus.OK);
- }
-
- @RequestMapping(method = RequestMethod.POST, value = "/addSupplier", produces =
-
- MediaType.APPLICATION_JSON_VALUE) // @PostMapping(path = "/addSupplier")
- public ResponseEntity createSupplier(@RequestBody Supplier supplier) {
- System.out.println(supplier);
- final Supplier supplierData;
- supplierData = supplierService.addSupplier(supplier);
- return new ResponseEntity(supplierData, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/deleteSupplier/{deleteById}", method = RequestMethod.GET)
- public ResponseEntity deleteSupplier(@PathVariable("deleteById") long deleteById) {
- final List supplierList;
- supplierList = supplierService.deleteSupplierById(deleteById);
- return new ResponseEntity(supplierList, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/updateSupplier/{updateById}", method = RequestMethod.GET)
- public ResponseEntity updateSupplier(@PathVariable("updateById") long updateById) {
- final Supplier supplier = supplierService.updateSupplierById(updateById);
- return new ResponseEntity(supplier, HttpStatus.OK);
- }
-
- @RequestMapping(method = RequestMethod.POST, value = "/addRetailer", produces = MediaType.APPLICATION_JSON_VALUE) // @PostMapping(path
- // =
- // "/addRetailer")
- public ResponseEntity createRetailer(@RequestBody Retailer retailer) {
- System.out.println(retailer);
- final Retailer retailerData;
- retailerData = retailerService.addRetailer(retailer);
- return new ResponseEntity(retailerData, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/deleteRetailer/{deleteById}", method = RequestMethod.GET)
- public ResponseEntity deleteRetailer(@PathVariable("deleteById") long deleteById) {
- final List retailerList;
- retailerList = retailerService.deleteRetailerById(deleteById);
- return new ResponseEntity(retailerList, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/updateRetailer/{updateById}", method = RequestMethod.GET)
- public ResponseEntity updateRetailer(@PathVariable("updateById") long updateById) {
- final Retailer retailer = retailerService.updateRetailerById(updateById);
- return new ResponseEntity(retailer, HttpStatus.OK);
- }
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/exception/ManagedException.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/exception/ManagedException.java
deleted file mode 100644
index 3da2658f..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/exception/ManagedException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- *
- */
-package com.training.springbootjpa.exception;
-
-/**
- * @author trainee
- *
- */
-public class ManagedException extends Exception {
-
-
- public ManagedException(final String errorMessage) {
-
- super(errorMessage);
-
- }
-
- public ManagedException() {
- // TODO Auto-generated constructor stub
- }
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Customer.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Customer.java
deleted file mode 100644
index 1b2087b6..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Customer.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package com.training.springbootjpa.model;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * @author RamDAfale
- *
- */
-@Entity
-@Table(name = "customer")
-public class Customer {
-
- @Id
- @GeneratedValue(strategy=GenerationType.AUTO)
- private Long customerId;
- private String customerName;
- private String customerAddress;
- private String paymentMode;
-
-
-
- /**
- * Default constructor which will help spring Mapper to map all entitites.
- */
- public Customer() {
- super();
- }
-
- /**
- * @param customerId
- * @param customerName
- * @param customerAddress
- * @param paymentMode
- */
- public Customer(Long customerId, String customerName,
- String customerAddress, String paymentMode) {
- this.customerId = customerId;
- this.customerName = customerName;
- this.customerAddress = customerAddress;
- this.paymentMode = paymentMode;
-
-
- }
-
- /**
- * @return the customerId
- */
- public Long getCustomerId() {
- return customerId;
- }
-
- /**
- * @param customerId
- * the customerId to set
- */
- public void setCustomerId(Long customerId) {
- this.customerId = customerId;
- }
-
- /**
- * @return the customerName
- */
- public String getCustomerName() {
- return customerName;
- }
-
- /**
- * @param customerName
- * the customerName to set
- */
- public void setCustomerName(String customerName) {
- this.customerName = customerName;
- }
-
- /**
- * @return the customerAddress
- */
- public String getCustomerAddress() {
- return customerAddress;
- }
-
- /**
- * @param customerAddress
- * the customerAddress to set
- */
- public void setCustomerAddress(String customerAddress) {
- this.customerAddress = customerAddress;
- }
-
- /**
- * @return the paymentMode
- */
- public String getPaymentMode() {
- return paymentMode;
- }
-
- /**
- * @param paymentMode
- * the paymentMode to set
- */
- public void setPaymentMode(String paymentMode) {
- this.paymentMode = paymentMode;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Customer [customerId=" + customerId + ", customerName=" + customerName + ", customerAddress="
- + customerAddress + ", paymentMode=" + paymentMode + "]";
- }
-
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Goods.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Goods.java
deleted file mode 100644
index 4b576333..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Goods.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package com.training.springbootjpa.model;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "goods")
-public class Goods {
-
- @Id
- @GeneratedValue(strategy=GenerationType.AUTO)
- private Long goodsId;
- private String goodsName;
- private Integer goodsQuantity;
- private Double goodsPrice;
-
-
-
- /**
- *
- */
- public Goods() {
- super();
- }
-
- /**
- * @param goodsId
- * @param goodsName
- * @param goodsQuantity
- * @param goodsPrice
- * @param supplierId
- */
- public Goods(Long goodsId, String goodsName, Integer goodsQuantity, Double goodsPrice, Long supplierId) {
- super();
- this.goodsId = goodsId;
- this.goodsName = goodsName;
- this.goodsQuantity = goodsQuantity;
- this.goodsPrice = goodsPrice;
-
- }
-
- /**
- * @return the goodsId
- */
- public Long getGoodsId() {
- return goodsId;
- }
- /**
- * @param goodsId the goodsId to set
- */
- public void setGoodsId(Long goodsId) {
- this.goodsId = goodsId;
- }
- /**
- * @return the goodsName
- */
- public String getGoodsName() {
- return goodsName;
- }
- /**
- * @param goodsName the goodsName to set
- */
- public void setGoodsName(String goodsName) {
- this.goodsName = goodsName;
- }
- /**
- * @return the goodsQuantity
- */
- public Integer getGoodsQuantity() {
- return goodsQuantity;
- }
- /**
- * @param goodsQuantity the goodsQuantity to set
- */
- public void setGoodsQuantity(Integer goodsQuantity) {
- this.goodsQuantity = goodsQuantity;
- }
- /**
- * @return the goodsPrice
- */
- public Double getGoodsPrice() {
- return goodsPrice;
- }
- /**
- * @param goodsPrice the goodsPrice to set
- */
- public void setGoodsPrice(Double goodsPrice) {
- this.goodsPrice = goodsPrice;
- }
-
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Goods [goodsId=" + goodsId + ", goodsName=" + goodsName + ", goodsQuantity=" + goodsQuantity
- + ", goodsPrice=" + goodsPrice + "]";
- }
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Retailer.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Retailer.java
deleted file mode 100644
index 24b14dfa..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Retailer.java
+++ /dev/null
@@ -1,102 +0,0 @@
-
-package com.training.springbootjpa.model;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * @author RamDAfale
- *
- */
-@Entity
-@Table(name = "retailer")
-public class Retailer {
-
- @Id
- @GeneratedValue(strategy=GenerationType.AUTO)
- private Long retailerId;
- private String retailerName;
- private String retailerAddress;
-
- /**
- * @param retailerId
- * @param retailerName
- * @param retailerAddress
- */
- public Retailer(Long retailerId, String retailerName, String retailerAddress) {
- super();
- this.retailerId = retailerId;
- this.retailerName = retailerName;
- this.retailerAddress = retailerAddress;
- }
-
- /**
- *
- */
- public Retailer() {
- super();
- }
-
- /**
- * @return the retailerId
- */
- public Long getRetailerId() {
- return retailerId;
- }
-
- /**
- * @param retailerId
- * the retailerId to set
- */
- public void setRetailerId(Long retailerId) {
- this.retailerId = retailerId;
- }
-
- /**
- * @return the retailerName
- */
- public String getRetailerName() {
- return retailerName;
- }
-
- /**
- * @param retailerName
- * the retailerName to set
- */
- public void setRetailerName(String retailerName) {
- this.retailerName = retailerName;
- }
-
- /**
- * @return the retailerAddress
- */
- public String getRetailerAddress() {
- return retailerAddress;
- }
-
- /**
- * @param retailerAddress
- * the retailerAddres to set
- */
- public void setRetailerAddress(String retailerAddress) {
- this.retailerAddress = retailerAddress;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Retailer [retailerId=" + retailerId + ", retailerName=" + retailerName + ", retailerAddress="
- + retailerAddress + ", getRetailerId()=" + getRetailerId() + ", getRetailerName()=" + getRetailerName()
- + ", getRetailerAddress()=" + getRetailerAddress() + ", getClass()=" + getClass() + ", hashCode()="
- + hashCode() + ", toString()=" + super.toString() + "]";
- }
-
-
-
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Supplier.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Supplier.java
deleted file mode 100644
index c0124bc8..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/model/Supplier.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package com.training.springbootjpa.model;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * @author RamDAfale
- *
- */
-@Entity
-@Table(name = "supplier")
-public class Supplier {
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private Long supplierId;
- private String supplierName;
- private String supplierAddress;
- private int quantityOrder;
- private int orderId;
- private Double amount;
-
-
- /**
- *
- */
- public Supplier() {
- super();
- }
-
- /**
- * @param supplierId
- * @param supplierName
- * @param supplierAddress
- * @param quantityOrder
- * @param orderId
- * @param amount
- * @param retailerId
- */
- public Supplier(Long supplierId, String supplierName, String supplierAddress, int quantityOrder, int orderId,
- Double amount, String retailerId) {
- this.supplierId = supplierId;
- this.supplierName = supplierName;
- this.supplierAddress = supplierAddress;
- this.quantityOrder = quantityOrder;
- this.orderId = orderId;
- this.amount = amount;
-
- }
-
- /**
- * @return the supplierId
- */
- public Long getSupplierId() {
- return supplierId;
- }
-
- /**
- * @param supplierId
- * the supplierId to set
- */
- public void setSupplierId(Long supplierId) {
- this.supplierId = supplierId;
- }
-
- /**
- * @return the supplierName
- */
- public String getSupplierName() {
- return supplierName;
- }
-
- /**
- * @param supplierName
- * the supplierName to set
- */
- public void setSupplierName(String supplierName) {
- this.supplierName = supplierName;
- }
-
- /**
- * @return the supplierAddress
- */
- public String getSupplierAddress() {
- return supplierAddress;
- }
-
- /**
- * @param supplierAddress
- * the supplierAddress to set
- */
- public void setSupplierAddress(String supplierAddress) {
- this.supplierAddress = supplierAddress;
- }
-
- /**
- * @return the quantityOrder
- */
- public int getQuantityOrder() {
- return quantityOrder;
- }
-
- /**
- * @param quantityOrder
- * the quantityOrder to set
- */
- public void setQuantityOrder(int quantityOrder) {
- this.quantityOrder = quantityOrder;
- }
-
- /**
- * @return the orderId
- */
- public int getOrderId() {
- return orderId;
- }
-
- /**
- * @param orderId
- * the orderId to set
- */
- public void setOrderId(int orderId) {
- this.orderId = orderId;
- }
-
- /**
- * @return the amount
- */
- public Double getAmount() {
- return amount;
- }
-
- /**
- * @param amount
- * the amount to set
- */
- public void setAmount(Double amount) {
- this.amount = amount;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
-
- @Override
- public String toString() {
- return "Supplier [supplierId=" + supplierId + ", supplierName=" + supplierName + ", supplierAddress="
- + supplierAddress + ", quantityOrder=" + quantityOrder + ", orderId=" + orderId + ", amount=" + amount
- + "]";
- }
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/CustomerDAO.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/CustomerDAO.java
deleted file mode 100644
index 5dfc1a06..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/CustomerDAO.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.training.springbootjpa.repository;
-
-import java.util.List;
-
-import org.springframework.data.repository.CrudRepository;
-
-import com.training.springbootjpa.exception.ManagedException;
-import com.training.springbootjpa.model.Customer;
-
-public interface CustomerDAO extends CrudRepository {
-
- /*
- *this method find your name in database and return the details if name found
- *also this method internally fire a select query based on parameter you pass to it.
- */
- Customer findByCustomerName(String customerName) throws ManagedException;
-
- /*
- this method find your name & database in database and return the details if name & address is found
- also this method internally fire a select query based on parameter you pass to it.
- */
-
- List findByCustomerNameAndCustomerAddress(String customerName, String customerAddress);
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/GoodsDAO.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/GoodsDAO.java
deleted file mode 100644
index 0ee1b2dc..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/GoodsDAO.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.training.springbootjpa.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import com.training.springbootjpa.model.Goods;
-
-public interface GoodsDAO extends JpaRepository{
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/RetailerDAO.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/RetailerDAO.java
deleted file mode 100644
index 417774f1..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/RetailerDAO.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.training.springbootjpa.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-
-import com.training.springbootjpa.model.Retailer;
-
-public interface RetailerDAO extends JpaRepository {
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/SupplierDAO.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/SupplierDAO.java
deleted file mode 100644
index edae2df1..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/repository/SupplierDAO.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.training.springbootjpa.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import com.training.springbootjpa.model.Supplier;
-
-public interface SupplierDAO extends JpaRepository {
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/CustomerService.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/CustomerService.java
deleted file mode 100644
index c4cac702..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/CustomerService.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.List;
-
-import com.training.springbootjpa.exception.ManagedException;
-import com.training.springbootjpa.model.Customer;
-
-public interface CustomerService {
-
- Customer addCustomer(Customer customer) throws ManagedException;
-
- Customer deleteCustomerById(long deleteById)throws ManagedException ;
-
- Customer updateCustomerById(long updateById);
-
- List getCustomer();
-
- String getCustomerDetail(Long id) throws ManagedException;
-
-
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/CustomerServiceImpl.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/CustomerServiceImpl.java
deleted file mode 100644
index a429b528..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/CustomerServiceImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Optional;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.training.springbootjpa.exception.ManagedException;
-import com.training.springbootjpa.model.Customer;
-import com.training.springbootjpa.repository.CustomerDAO;
-
-/**
- * @author RamDAfale
- *
- */
-
-@Service("customerService")
-public class CustomerServiceImpl implements CustomerService {
-
- @Autowired
- private CustomerDAO customerDAO;
-
- @Override
- public Customer addCustomer(Customer customer) throws ManagedException {
- Customer customerData = customerDAO.save(customer);
- if ( customerData.getCustomerName()==null || customerData.getPaymentMode() == null )
- {
- throw new ManagedException("provide correct details");
- }
- else
-
- return customerData;
- }
-
-
-
-
-
-
-
- @Override
- public Customer deleteCustomerById(long deleteById) throws ManagedException {
-
- Optional customer=customerDAO.findById(deleteById);
- if(customer.isPresent())
- {
- customerDAO.deleteById(deleteById);
- }
- else
- {
- throw new ManagedException("Id not Found");
-
- }
- return null;
- }
-
-
-
- @Override
- public Customer updateCustomerById(long updateById) {
- Optional customer = customerDAO.findById(updateById);
- Customer customerDummy = customer.get();
- customerDummy.setCustomerAddress("Newyork");
- return customerDummy;
- }
-
- @Override
- public List getCustomer() {
-
- return (List) customerDAO.findAll();
- }
-
- @Override
- public String getCustomerDetail(Long id) throws ManagedException {
-
- Optional customerData = customerDAO.findById(id);
- if (customerData.isPresent()) {
- return "Data Found";
- } else
- return "Not Found";
- }
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/GoodsService.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/GoodsService.java
deleted file mode 100644
index dd268389..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/GoodsService.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.List;
-import com.training.springbootjpa.model.Goods;
-
-public interface GoodsService {
-
- Goods addGoods(Goods goods);
-
- public List deleteGoodsById(long deleteById);
-
- public Goods updateGoodsById(long updateById);
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/GoodsServiceImpl.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/GoodsServiceImpl.java
deleted file mode 100644
index 45b4ce39..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/GoodsServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Optional;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.training.springbootjpa.model.Goods;
-import com.training.springbootjpa.repository.GoodsDAO;
-
-/**
- * @author RamDAfale
- *
- */
-@Service("goodsService")
-public class GoodsServiceImpl implements GoodsService {
-
- @Autowired
- private GoodsDAO goodsDAO;
-
- @Override
- public Goods addGoods(Goods goods) {
- Goods goodsData = goodsDAO.save(goods);
- return goodsData;
- }
-
- @Override
- public List deleteGoodsById(long deleteById) {
- List goodsList = goodsDAO.findAll();
- Iterator iterator = goodsList.iterator();
- while (iterator.hasNext()) {
- Goods goods = (Goods) iterator.next();
- if (goods.getGoodsId() == deleteById) {
- goodsDAO.deleteById(deleteById);
- }
- }
- return goodsList;
- }
-
- @Override
- public Goods updateGoodsById(long updateById) {
- Optional goods = goodsDAO.findById(updateById);
- Goods goodsDummy = goods.get();
- goodsDummy.setGoodsPrice(1021.12);
- return goodsDummy;
- }
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/RetailerService.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/RetailerService.java
deleted file mode 100644
index 8fe6025f..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/RetailerService.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.List;
-
-import com.training.springbootjpa.model.Retailer;
-
-public interface RetailerService {
-
- public Retailer addRetailer(Retailer retailer);
-
- public List deleteRetailerById(long deleteById);
-
- public Retailer updateRetailerById(long updateById);
-
-
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/RetailerServiceImpl.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/RetailerServiceImpl.java
deleted file mode 100644
index bad09c2a..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/RetailerServiceImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Optional;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.training.springbootjpa.model.Retailer;
-import com.training.springbootjpa.repository.RetailerDAO;
-
-@Service("retailerService")
-public class RetailerServiceImpl implements RetailerService {
-
- @Autowired
- private RetailerDAO retailerDAO;
-
- @Override
- public Retailer addRetailer(Retailer retailer) {
- Retailer retailerData = retailerDAO.save(retailer);
- return retailerData;
- }
-
- @Override
- public List deleteRetailerById(long deleteById) {
- List retailerList = retailerDAO.findAll();
- Iterator iterator = retailerList.iterator();
- while (iterator.hasNext()) {
- Retailer retailer = (Retailer) iterator.next();
- if (retailer.getRetailerId() == deleteById) {
- retailerDAO.deleteById(deleteById);
- }
- }
- return retailerList;
- }
-
- @Override
- public Retailer updateRetailerById(long updateById) {
- Optional retailer = retailerDAO.findById(updateById);
- Retailer retailerDummy = retailer.get();
- retailerDummy.setRetailerAddress("Changed Address at Winterfell");
- return retailerDummy;
- }
-
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/SupplierService.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/SupplierService.java
deleted file mode 100644
index 55213cfb..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/SupplierService.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.List;
-import com.training.springbootjpa.model.Supplier;
-
-public interface SupplierService {
-
- public Supplier addSupplier(Supplier supplier);
-
- public List deleteSupplierById(long deleteById);
-
- public Supplier updateSupplierById(long updateById);
-}
diff --git a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/SupplierServiceImpl.java b/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/SupplierServiceImpl.java
deleted file mode 100644
index ecec5b91..00000000
--- a/14SpringBootJPAmysql/src/main/java/com/training/springbootjpa/service/SupplierServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Optional;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.training.springbootjpa.model.Supplier;
-import com.training.springbootjpa.repository.SupplierDAO;
-
-@Service("supplierService")
-public class SupplierServiceImpl implements SupplierService {
-
- @Autowired
- private SupplierDAO supplierDAO;
-
- @Override
- public Supplier addSupplier(Supplier supplier) {
- Supplier supplierData = supplierDAO.save(supplier);
- return supplierData;
- }
-
- @Override
- public List deleteSupplierById(long deleteById) {
- List supplierList = supplierDAO.findAll();
- Iterator iterator = supplierList.iterator();
- while (iterator.hasNext()) {
- Supplier supplier = (Supplier) iterator.next();
- if (supplier.getSupplierId() == deleteById) {
- supplierDAO.deleteById(deleteById);
- }
- }
- return supplierList;
- }
-
- @Override
- public Supplier updateSupplierById(long updateById) {
- Optional supplier = supplierDAO.findById(updateById);
- Supplier supplierDummy = supplier.get();
- supplierDummy.setQuantityOrder(123);
- return supplierDummy;
- }
-
-}
diff --git a/14SpringBootJPAmysql/src/main/resources/application.properties b/14SpringBootJPAmysql/src/main/resources/application.properties
deleted file mode 100644
index 208459e0..00000000
--- a/14SpringBootJPAmysql/src/main/resources/application.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-spring.jpa.show-sql=true
-spring.jpa.hibernate.ddl-auto=update
-spring.h2.console.enabled=true
-spring.datasource.url=jdbc:h2:~/test;DB_CLOSE_ON_EXIT=FALSE
\ No newline at end of file
diff --git a/14SpringBootJPAmysql/src/main/resources/banner b/14SpringBootJPAmysql/src/main/resources/banner
deleted file mode 100644
index 851712cf..00000000
--- a/14SpringBootJPAmysql/src/main/resources/banner
+++ /dev/null
@@ -1,13 +0,0 @@
-spring.banner.location=classpath:/src/main/resources/bannername.txt
-
-
-
-
-
-${Ansi.GREEN} _ __ _
-${Ansi.GREEN} /\/\ ___ _ __ ___ ___ _ __ _ _ _ __ ___ | |_ / _| ___ _ _ _ __ __| | ___ ___ _ __ ___
-${Ansi.GREEN} / \ / _ \ '_ ` _ \ / _ \| '__| | | | '_ \ / _ \| __| |_ / _ \| | | | '_ \ / _` | / __/ _ \| '_ ` _ \
-${Ansi.GREEN} / /\/\ \ __/ | | | | | (_) | | | |_| | | | | (_) | |_| _| (_) | |_| | | | | (_| || (_| (_) | | | | | |
-${Ansi.GREEN} \/ \/\___|_| |_| |_|\___/|_| \__, |_| |_|\___/ \__|_| \___/ \__,_|_| |_|\__,_(_)___\___/|_| |_| |_|
-${Ansi.GREEN} |___/
-${Ansi.RED} :: Spring Boot${spring-boot.formatted-version} :: ${Ansi.DEFAULT}
\ No newline at end of file
diff --git a/14SpringBootJPAmysql/src/test/java/com/training/springbootjpa/SpringbootjpaApplicationTests.java b/14SpringBootJPAmysql/src/test/java/com/training/springbootjpa/SpringbootjpaApplicationTests.java
deleted file mode 100644
index 6ba1f55f..00000000
--- a/14SpringBootJPAmysql/src/test/java/com/training/springbootjpa/SpringbootjpaApplicationTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.training.springbootjpa;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import com.training.springbootjpa.controller.MainController;
-import com.training.springbootjpa.model.Customer;
-import com.training.springbootjpa.service.CustomerServiceImpl;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class SpringbootjpaApplicationTests {
-
-
-
-
-
-/* @Autowired
- CustomerServiceImpl mc;
-
-
- @Test
- public void testFindByCategory() {
- List books = mc.
- assertEquals(1, books.size());
-
- for (Customer book : books) {
- assertEquals(this.book.getCategory().getId(), category.getId());
- assertEquals(this.book.getAuthor(), book.getAuthor());
- assertEquals(this.book.getDescription(), book.getDescription());
- assertEquals(this.book.getIsbn(), book.getIsbn());
- }
- }*/
-
-}
diff --git a/15springBootJPACallingFromMainMethod/.gitignore b/15springBootJPACallingFromMainMethod/.gitignore
deleted file mode 100644
index 82eca336..00000000
--- a/15springBootJPACallingFromMainMethod/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/build/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
\ No newline at end of file
diff --git a/15springBootJPACallingFromMainMethod/.mvn/wrapper/maven-wrapper.jar b/15springBootJPACallingFromMainMethod/.mvn/wrapper/maven-wrapper.jar
deleted file mode 100644
index 9cc84ea9..00000000
Binary files a/15springBootJPACallingFromMainMethod/.mvn/wrapper/maven-wrapper.jar and /dev/null differ
diff --git a/15springBootJPACallingFromMainMethod/.mvn/wrapper/maven-wrapper.properties b/15springBootJPACallingFromMainMethod/.mvn/wrapper/maven-wrapper.properties
deleted file mode 100644
index b573bb50..00000000
--- a/15springBootJPACallingFromMainMethod/.mvn/wrapper/maven-wrapper.properties
+++ /dev/null
@@ -1 +0,0 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
diff --git a/15springBootJPACallingFromMainMethod/mvnw b/15springBootJPACallingFromMainMethod/mvnw
deleted file mode 100644
index 5bf251c0..00000000
--- a/15springBootJPACallingFromMainMethod/mvnw
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/15springBootJPACallingFromMainMethod/mvnw.cmd b/15springBootJPACallingFromMainMethod/mvnw.cmd
deleted file mode 100644
index 019bd74d..00000000
--- a/15springBootJPACallingFromMainMethod/mvnw.cmd
+++ /dev/null
@@ -1,143 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/15springBootJPACallingFromMainMethod/pom.xml b/15springBootJPACallingFromMainMethod/pom.xml
deleted file mode 100644
index d4966895..00000000
--- a/15springBootJPACallingFromMainMethod/pom.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
- 4.0.0
-
- com.training
- springbootjpa
- 0.0.1-SNAPSHOT
- jar
-
- springbootjpa
- Demo project for Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.1.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
-
- org.projectlombok
- lombok-maven
- 1.16.20.0
- pom
-
-
-
-
-
- org.json
- json
- 20090211
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- com.h2database
- h2
- runtime
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- org.mockito
- mockito-core
- 2.18.3
-
-
- org.mockito
- mockito-junit-jupiter
- 2.18.3
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/SpringbootjpaApplication.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/SpringbootjpaApplication.java
deleted file mode 100644
index cfc85aa6..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/SpringbootjpaApplication.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package com.training.springbootjpa;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import org.json.HTTP;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-import org.springframework.web.client.RestTemplate;
-
-import com.training.springbootjpa.controller.MainController;
-import com.training.springbootjpa.model.Customer;
-
-@SpringBootApplication
-public class SpringbootjpaApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(SpringbootjpaApplication.class, args);
-
- final Logger LOGGER = Logger.getLogger( MainController.class.getName() );
- System.out.println("In main class dfirst");
- //getCustomerById();
- System.out.println("In main class");
-
- //createCustomer();
-
- //deleteEmployee();
-
- customerUpdate();
-
-
-
-
-
- }
-
- private static void getCustomerById()
- {
- final Logger LOGGER = Logger.getLogger( MainController.class.getName() );
- final String uri = "http://localhost:8080/customer/{customerId}";
-
- Map params = new HashMap();
- params.put("customerId", 1L);
-
- RestTemplate restTemplate = new RestTemplate();
- Customer result = restTemplate.getForObject(uri, Customer.class, params);
-
- // LOGGER.info( result);
-
- System.out.println(result.toString());
- }
-
-
- private static void createCustomer()
- {
- final Logger LOGGER = Logger.getLogger( MainController.class.getName() );
- final String uri = "http://localhost:8080/addCustomer";
- System.out.println("In Add customer MEthod");
- // List list = new ArrayList();
-
- Customer cust = new Customer("Rama","SA","DEBIT");
-
- RestTemplate restTemplate = new RestTemplate();
- Customer result = restTemplate.postForObject(uri, cust,Customer.class);
- System.out.println("In Add customer adding");
- // LOGGER.info( result);
- System.out.println(result);
- //System.out.println(result.toString());
- }
-
-
-
- private static void deleteEmployee()
- {
- final String uri = "http://localhost:8080/delete/{customerId}";
-
- Map params = new HashMap();
- params.put("customerId", 2L);
-
- // Customer updatedEmployee = new Customer("Marvel", "NewYork", "CASH");
-
- RestTemplate restTemplate = new RestTemplate();
- restTemplate.put ( uri, Customer.class, params);
- }
-
-
-
- private static void customerUpdate()
- {
- final String uri = "http://localhost:8080/customerUpdate/{id}";
-
- Map params = new HashMap();
- params.put("id", 5L);
-
- Customer updatedEmployee = new Customer("Captain Marvel", "NewYork", "CASH");
-
- RestTemplate restTemplate = new RestTemplate();
- restTemplate.put ( uri, updatedEmployee, params);
- }
-
-
-
-}
-
-
-
-
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/controller/MainController.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/controller/MainController.java
deleted file mode 100644
index 81cea4d6..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/controller/MainController.java
+++ /dev/null
@@ -1,282 +0,0 @@
-package com.training.springbootjpa.controller;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.training.springbootjpa.exception.ManagedException;
-import com.training.springbootjpa.model.Customer;
-import com.training.springbootjpa.model.Goods;
-import com.training.springbootjpa.model.Retailer;
-import com.training.springbootjpa.model.Supplier;
-import com.training.springbootjpa.repository.CustomerDAO;
-import com.training.springbootjpa.service.CustomerService;
-import com.training.springbootjpa.service.GoodsService;
-import com.training.springbootjpa.service.RetailerService;
-import com.training.springbootjpa.service.SupplierService;
-
-@RestController
-public class MainController {
-
-
-
- private static final Logger LOGGER = Logger.getLogger( MainController.class.getName() );
- /*
- * with help of this annonation we can access all the proporties of bean we can
- * access all method of CustomerService.
- */
- @Autowired
- private CustomerService customerService;
-
- @Autowired
- private GoodsService goodsService;
-
- @Autowired
- private SupplierService supplierService;
-
- @Autowired
- private RetailerService retailerService;
-
- @Autowired
- CustomerDAO cdao;
-
- /*
- * Get Customer Details using Id Handling the exception using Custom Exception
- */
- @RequestMapping(value = "/customer/{id}", method = RequestMethod.GET)
- public ResponseEntity getCustomerById(@PathVariable Long id) throws ManagedException {
- LOGGER.info("Inside Get Customer By Id");
- Customer customer = null;
-
- try {
- customer = customerService.getCustomerDetail(id);
- } catch (ManagedException e) {
-
- e.getMessage();
- }
- System.out.println("Customer response >>>>" + customer);
-
- return new ResponseEntity(customer, HttpStatus.OK);
- }
-
- // Get Customer Details using Name
- // Handling the exception
- /*
- * Also we can send your whole Customer Details to UI using
- * ResponseEntity For now this method is just telling user that your
- * data is being get added succesfully.
- *
- */
-
- @RequestMapping(method = RequestMethod.GET, value = "/searchCustomer/{customerName}")
-
- public ResponseEntity searchCustomer(@PathVariable String customerName) throws ManagedException {
- LOGGER.info("Inside Get Customer By Name");
-
- Customer customerData = null;
-
- customerData = cdao.findByCustomerName(customerName);
- if (customerData == null)
- return new ResponseEntity("Data not found", HttpStatus.OK);
- else
- return new ResponseEntity("Data found", (MultiValueMap) customerData, HttpStatus.OK);
-
- }
-
- /*this method shows all customers to admin if requested
- */
-
- @RequestMapping(method = RequestMethod.GET, value = "/getAllCustomer")
- // @PostMapping(path = "/addCustomer")
- public ResponseEntity> getAllCustomer() {
- LOGGER.info("Inside Get All Customers ");
- final List customerData;
-
- customerData = customerService.getCustomer();
-
- return new ResponseEntity(customerData, HttpStatus.OK);
- }
-
-
- /*
- * This method add new customer to database
- * Exception Handling- if users provides Null to Textbox then it will throw Proper Message to user .
- */
- @RequestMapping(method = RequestMethod.POST, value = "/addCustomer")
- // @PostMapping(path = "/addCustomer")
- public ResponseEntity createCustomer(@RequestBody Customer customer) {
- System.out.println(customer.getCustomerName()+ customer.getPaymentMode() );
- LOGGER.info("Inside Add New Customer ");
- Customer customerData = null;
-
- try {
-
- customerData = customerService.addCustomer(customer);
- return new ResponseEntity(customerData, HttpStatus.OK);
-
- } catch (ManagedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- return new ResponseEntity("Provide valid input", HttpStatus.OK);
- }
-
-
- }
-
-
-
-
-
- /**
- * GET /delete Delete a customer details from the database.
- *
- *
- */
- @RequestMapping("/delete/{customerId}")
- public ResponseEntity deleteCustomerRecord(@PathVariable Long customerId) {
-
- Customer cust =null;
- LOGGER.info("Inside Delete Customer ");
- try {
- cust = customerService.deleteCustomerById(customerId);
- } catch (ManagedException e) {
-
-
- e.printStackTrace();
- return new ResponseEntity("Given Id not found", HttpStatus.OK);
- }
-
- return new ResponseEntity("Given Id deleted successfully ", HttpStatus.OK);
- }
-
-
- /**
- *
- * Another Implementation
- * GET /delete Delete a customer details from the database.
- *
- *
- */
-
-
-/**
- * GET /delete Delete a booking from the database.
- */
- /* @RequestMapping("/delete/{customerId}")
- public String deletecustomer(@PathVariable Long customerId) {
-
- LOGGER.info("Inside Delete Customer ");
- try {
- customerService.deleteCustomerById(customerId);
- } catch (ManagedException e) {
-
-
- e.printStackTrace();
- return "CustomerID #"+customerId+" Not Found";
- }
-
- return "CustomerID #"+customerId+" deleted successfully";
- }
-
-*/
-
-
-
-
-
- @PutMapping("/customerUpdate/{id}")
- public ResponseEntity> customerUpdate(@RequestBody final Customer customer,
- @PathVariable(value = "id") final Long id) {
- Long customerId;
- try {
- customerId = customerService.updateCustomer(customer, id);
- return new ResponseEntity(customerId, HttpStatus.OK);
- } catch (ManagedException e) {
- // TODO Auto-generated catch block
- String msg = e.getMessage();
- return new ResponseEntity(msg, HttpStatus.OK);
-
- }
-
- }
-
- @RequestMapping(method = RequestMethod.POST, value = "/addGoods", produces = MediaType.APPLICATION_JSON_VALUE)
- ResponseEntity createGoods(@RequestBody Goods goods) {
- System.out.println(goods);
- final Goods goodsData;
- goodsData = goodsService.addGoods(goods);
- return new ResponseEntity(goodsData, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/deleteGoods/{deleteById}", method = RequestMethod.GET)
- public ResponseEntity deleteGoods(@PathVariable("deleteById") long deleteById) {
- final List goodsList;
- goodsList = goodsService.deleteGoodsById(deleteById);
- return new ResponseEntity(goodsList, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/updateGoods/{updateById}", method = RequestMethod.GET)
- public ResponseEntity updateGoods(@PathVariable("updateById") long updateById) {
- final Goods goods = goodsService.updateGoodsById(updateById);
- return new ResponseEntity(goods, HttpStatus.OK);
- }
-
- @RequestMapping(method = RequestMethod.POST, value = "/addSupplier", produces =
-
- MediaType.APPLICATION_JSON_VALUE) // @PostMapping(path = "/addSupplier")
- public ResponseEntity createSupplier(@RequestBody Supplier supplier) {
- System.out.println(supplier);
- final Supplier supplierData;
- supplierData = supplierService.addSupplier(supplier);
- return new ResponseEntity(supplierData, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/deleteSupplier/{deleteById}", method = RequestMethod.GET)
- public ResponseEntity deleteSupplier(@PathVariable("deleteById") long deleteById) {
- final List supplierList;
- supplierList = supplierService.deleteSupplierById(deleteById);
- return new ResponseEntity(supplierList, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/updateSupplier/{updateById}", method = RequestMethod.GET)
- public ResponseEntity updateSupplier(@PathVariable("updateById") long updateById) {
- final Supplier supplier = supplierService.updateSupplierById(updateById);
- return new ResponseEntity(supplier, HttpStatus.OK);
- }
-
- @RequestMapping(method = RequestMethod.POST, value = "/addRetailer", produces = MediaType.APPLICATION_JSON_VALUE) // @PostMapping(path
- // =
- // "/addRetailer")
- public ResponseEntity createRetailer(@RequestBody Retailer retailer) {
- System.out.println(retailer);
- final Retailer retailerData;
- retailerData = retailerService.addRetailer(retailer);
- return new ResponseEntity(retailerData, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/deleteRetailer/{deleteById}", method = RequestMethod.GET)
- public ResponseEntity deleteRetailer(@PathVariable("deleteById") long deleteById) {
- final List retailerList;
- retailerList = retailerService.deleteRetailerById(deleteById);
- return new ResponseEntity(retailerList, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/updateRetailer/{updateById}", method = RequestMethod.GET)
- public ResponseEntity updateRetailer(@PathVariable("updateById") long updateById) {
- final Retailer retailer = retailerService.updateRetailerById(updateById);
- return new ResponseEntity(retailer, HttpStatus.OK);
- }
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/exception/ManagedException.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/exception/ManagedException.java
deleted file mode 100644
index 3da2658f..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/exception/ManagedException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- *
- */
-package com.training.springbootjpa.exception;
-
-/**
- * @author trainee
- *
- */
-public class ManagedException extends Exception {
-
-
- public ManagedException(final String errorMessage) {
-
- super(errorMessage);
-
- }
-
- public ManagedException() {
- // TODO Auto-generated constructor stub
- }
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Customer.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Customer.java
deleted file mode 100644
index 7c6a99ab..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Customer.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package com.training.springbootjpa.model;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * @author RamDAfale
- *
- */
-@Entity
-@Table(name = "customer")
-public class Customer {
-
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private long customerId;
- private String customerName;
- private String customerAddress;
- private String paymentMode;
-
- /**
- * @param customerId
- * @param customerName
- * @param customerAddress
- *
- * @param paymentMode
- */
- public Customer() {
- }
-
- public Customer(String customerName, String customerAddress, String paymentMode) {
- this.customerName = customerName;
- this.customerAddress = customerAddress;
- this.paymentMode = paymentMode;
- }
-
- /**
- * @return the customerId
- */
- public Long getCustomerId() {
- return customerId;
- }
-
- /**
- * @param customerId
- * the customerId to set
- */
- public void setCustomerId(Long customerId) {
- this.customerId = customerId;
- }
-
- /**
- * @return the customerName
- */
- public String getCustomerName() {
- return customerName;
- }
-
- /**
- * @param customerName
- * the customerName to set
- */
- public void setCustomerName(String customerName) {
- this.customerName = customerName;
- }
-
- /**
- * @return the customerAddress
- */
- public String getCustomerAddress() {
- return customerAddress;
- }
-
- /**
- * @param customerAddress
- * the customerAddress to set
- */
- public void setCustomerAddress(String customerAddress) {
- this.customerAddress = customerAddress;
- }
-
- /**
- * @return the paymentMode
- */
- public String getPaymentMode() {
- return paymentMode;
- }
-
- /**
- * @param paymentMode
- * the paymentMode to set
- */
- public void setPaymentMode(String paymentMode) {
- this.paymentMode = paymentMode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Customer [customerId=" + customerId + ", customerName=" + customerName + ", customerAddress="
- + customerAddress + ", paymentMode=" + paymentMode + "]";
- }
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Goods.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Goods.java
deleted file mode 100644
index 4b576333..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Goods.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package com.training.springbootjpa.model;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "goods")
-public class Goods {
-
- @Id
- @GeneratedValue(strategy=GenerationType.AUTO)
- private Long goodsId;
- private String goodsName;
- private Integer goodsQuantity;
- private Double goodsPrice;
-
-
-
- /**
- *
- */
- public Goods() {
- super();
- }
-
- /**
- * @param goodsId
- * @param goodsName
- * @param goodsQuantity
- * @param goodsPrice
- * @param supplierId
- */
- public Goods(Long goodsId, String goodsName, Integer goodsQuantity, Double goodsPrice, Long supplierId) {
- super();
- this.goodsId = goodsId;
- this.goodsName = goodsName;
- this.goodsQuantity = goodsQuantity;
- this.goodsPrice = goodsPrice;
-
- }
-
- /**
- * @return the goodsId
- */
- public Long getGoodsId() {
- return goodsId;
- }
- /**
- * @param goodsId the goodsId to set
- */
- public void setGoodsId(Long goodsId) {
- this.goodsId = goodsId;
- }
- /**
- * @return the goodsName
- */
- public String getGoodsName() {
- return goodsName;
- }
- /**
- * @param goodsName the goodsName to set
- */
- public void setGoodsName(String goodsName) {
- this.goodsName = goodsName;
- }
- /**
- * @return the goodsQuantity
- */
- public Integer getGoodsQuantity() {
- return goodsQuantity;
- }
- /**
- * @param goodsQuantity the goodsQuantity to set
- */
- public void setGoodsQuantity(Integer goodsQuantity) {
- this.goodsQuantity = goodsQuantity;
- }
- /**
- * @return the goodsPrice
- */
- public Double getGoodsPrice() {
- return goodsPrice;
- }
- /**
- * @param goodsPrice the goodsPrice to set
- */
- public void setGoodsPrice(Double goodsPrice) {
- this.goodsPrice = goodsPrice;
- }
-
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Goods [goodsId=" + goodsId + ", goodsName=" + goodsName + ", goodsQuantity=" + goodsQuantity
- + ", goodsPrice=" + goodsPrice + "]";
- }
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Retailer.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Retailer.java
deleted file mode 100644
index 24b14dfa..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Retailer.java
+++ /dev/null
@@ -1,102 +0,0 @@
-
-package com.training.springbootjpa.model;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * @author RamDAfale
- *
- */
-@Entity
-@Table(name = "retailer")
-public class Retailer {
-
- @Id
- @GeneratedValue(strategy=GenerationType.AUTO)
- private Long retailerId;
- private String retailerName;
- private String retailerAddress;
-
- /**
- * @param retailerId
- * @param retailerName
- * @param retailerAddress
- */
- public Retailer(Long retailerId, String retailerName, String retailerAddress) {
- super();
- this.retailerId = retailerId;
- this.retailerName = retailerName;
- this.retailerAddress = retailerAddress;
- }
-
- /**
- *
- */
- public Retailer() {
- super();
- }
-
- /**
- * @return the retailerId
- */
- public Long getRetailerId() {
- return retailerId;
- }
-
- /**
- * @param retailerId
- * the retailerId to set
- */
- public void setRetailerId(Long retailerId) {
- this.retailerId = retailerId;
- }
-
- /**
- * @return the retailerName
- */
- public String getRetailerName() {
- return retailerName;
- }
-
- /**
- * @param retailerName
- * the retailerName to set
- */
- public void setRetailerName(String retailerName) {
- this.retailerName = retailerName;
- }
-
- /**
- * @return the retailerAddress
- */
- public String getRetailerAddress() {
- return retailerAddress;
- }
-
- /**
- * @param retailerAddress
- * the retailerAddres to set
- */
- public void setRetailerAddress(String retailerAddress) {
- this.retailerAddress = retailerAddress;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Retailer [retailerId=" + retailerId + ", retailerName=" + retailerName + ", retailerAddress="
- + retailerAddress + ", getRetailerId()=" + getRetailerId() + ", getRetailerName()=" + getRetailerName()
- + ", getRetailerAddress()=" + getRetailerAddress() + ", getClass()=" + getClass() + ", hashCode()="
- + hashCode() + ", toString()=" + super.toString() + "]";
- }
-
-
-
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Supplier.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Supplier.java
deleted file mode 100644
index c0124bc8..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/model/Supplier.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package com.training.springbootjpa.model;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * @author RamDAfale
- *
- */
-@Entity
-@Table(name = "supplier")
-public class Supplier {
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private Long supplierId;
- private String supplierName;
- private String supplierAddress;
- private int quantityOrder;
- private int orderId;
- private Double amount;
-
-
- /**
- *
- */
- public Supplier() {
- super();
- }
-
- /**
- * @param supplierId
- * @param supplierName
- * @param supplierAddress
- * @param quantityOrder
- * @param orderId
- * @param amount
- * @param retailerId
- */
- public Supplier(Long supplierId, String supplierName, String supplierAddress, int quantityOrder, int orderId,
- Double amount, String retailerId) {
- this.supplierId = supplierId;
- this.supplierName = supplierName;
- this.supplierAddress = supplierAddress;
- this.quantityOrder = quantityOrder;
- this.orderId = orderId;
- this.amount = amount;
-
- }
-
- /**
- * @return the supplierId
- */
- public Long getSupplierId() {
- return supplierId;
- }
-
- /**
- * @param supplierId
- * the supplierId to set
- */
- public void setSupplierId(Long supplierId) {
- this.supplierId = supplierId;
- }
-
- /**
- * @return the supplierName
- */
- public String getSupplierName() {
- return supplierName;
- }
-
- /**
- * @param supplierName
- * the supplierName to set
- */
- public void setSupplierName(String supplierName) {
- this.supplierName = supplierName;
- }
-
- /**
- * @return the supplierAddress
- */
- public String getSupplierAddress() {
- return supplierAddress;
- }
-
- /**
- * @param supplierAddress
- * the supplierAddress to set
- */
- public void setSupplierAddress(String supplierAddress) {
- this.supplierAddress = supplierAddress;
- }
-
- /**
- * @return the quantityOrder
- */
- public int getQuantityOrder() {
- return quantityOrder;
- }
-
- /**
- * @param quantityOrder
- * the quantityOrder to set
- */
- public void setQuantityOrder(int quantityOrder) {
- this.quantityOrder = quantityOrder;
- }
-
- /**
- * @return the orderId
- */
- public int getOrderId() {
- return orderId;
- }
-
- /**
- * @param orderId
- * the orderId to set
- */
- public void setOrderId(int orderId) {
- this.orderId = orderId;
- }
-
- /**
- * @return the amount
- */
- public Double getAmount() {
- return amount;
- }
-
- /**
- * @param amount
- * the amount to set
- */
- public void setAmount(Double amount) {
- this.amount = amount;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
-
- @Override
- public String toString() {
- return "Supplier [supplierId=" + supplierId + ", supplierName=" + supplierName + ", supplierAddress="
- + supplierAddress + ", quantityOrder=" + quantityOrder + ", orderId=" + orderId + ", amount=" + amount
- + "]";
- }
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/CustomerDAO.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/CustomerDAO.java
deleted file mode 100644
index 37168ec0..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/CustomerDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.training.springbootjpa.repository;
-
-import java.util.List;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.repository.CrudRepository;
-
-import com.training.springbootjpa.exception.ManagedException;
-import com.training.springbootjpa.model.Customer;
-
-public interface CustomerDAO extends JpaRepository {
-
- /*
- *this method find your name in database and return the details if name found
- *also this method internally fire a select query based on parameter you pass to it.
- */
- Customer findByCustomerName(String customerName) throws ManagedException;
-
- /*
- this method find your name & database in database and return the details if name & address is found
- also this method internally fire a select query based on parameter you pass to it.
- */
-
- List findByCustomerNameAndCustomerAddress(String customerName, String customerAddress);
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/GoodsDAO.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/GoodsDAO.java
deleted file mode 100644
index 0ee1b2dc..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/GoodsDAO.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.training.springbootjpa.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import com.training.springbootjpa.model.Goods;
-
-public interface GoodsDAO extends JpaRepository{
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/RetailerDAO.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/RetailerDAO.java
deleted file mode 100644
index 417774f1..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/RetailerDAO.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.training.springbootjpa.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-
-import com.training.springbootjpa.model.Retailer;
-
-public interface RetailerDAO extends JpaRepository {
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/SupplierDAO.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/SupplierDAO.java
deleted file mode 100644
index edae2df1..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/repository/SupplierDAO.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.training.springbootjpa.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import com.training.springbootjpa.model.Supplier;
-
-public interface SupplierDAO extends JpaRepository {
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/CustomerService.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/CustomerService.java
deleted file mode 100644
index ab5558cc..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/CustomerService.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.List;
-
-import com.training.springbootjpa.exception.ManagedException;
-import com.training.springbootjpa.model.Customer;
-
-public interface CustomerService {
-
- Customer addCustomer(Customer customer) throws ManagedException;
-
- Customer deleteCustomerById(long deleteById)throws ManagedException ;
-
- //Customer updateCustomerById(long updateById);
-
- List getCustomer();
-
- Customer getCustomerDetail(Long id) throws ManagedException;
-
- Long updateCustomer(Customer customerReq, Long id) throws ManagedException;
-
-
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/CustomerServiceImpl.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/CustomerServiceImpl.java
deleted file mode 100644
index 747ed57f..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/CustomerServiceImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Optional;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.training.springbootjpa.exception.ManagedException;
-import com.training.springbootjpa.model.Customer;
-import com.training.springbootjpa.repository.CustomerDAO;
-
-/**
- * @author RamDAfale
- *
- */
-
-@Service("customerService")
-public class CustomerServiceImpl implements CustomerService {
-
- @Autowired
- private CustomerDAO customerDAO;
-
- @Override
- public Customer addCustomer(Customer customer) throws ManagedException {
- Customer customerData = customerDAO.save(customer);
- System.out.println(customerData.getCustomerName()+ customerData.getPaymentMode() );
- if ( customerData.getCustomerName()==null || customerData.getPaymentMode() == null )
- {
- throw new ManagedException("provide correct details");
- }
- else
-
- return customerData;
- }
-
-
-
-
-
-
-
- @Override
- public Customer deleteCustomerById(long deleteById) throws ManagedException {
-
- Optional customer=customerDAO.findById(deleteById);
- if(customer.isPresent())
- {
- customerDAO.deleteById(deleteById);
- }
- else
- {
- throw new ManagedException("Id not Found");
-
- }
- return null;
- }
-
-
-
- @Override
- public Long updateCustomer(Customer customerReq, Long id) throws ManagedException {
- // TODO Auto-generated method stub
- Optional customer = customerDAO.findById(id);
- if (customer.isPresent()) {
- Customer cust = customerDAO.getOne(id);
- if (customerReq.getPaymentMode() != null) {
- cust.setPaymentMode(customerReq.getPaymentMode());
- //LOGGER.info("hello");
- }
- if (customerReq.getCustomerAddress() != null) {
- cust.setCustomerAddress(customerReq.getCustomerAddress());
- }
- if (customerReq.getCustomerName() != null) {
- cust.setCustomerName(customerReq.getCustomerName());
- }
-
-
- customerDAO.save(cust);
- } else {
- throw new ManagedException("Sorry !! such record not exist in database");
- }
-
- return id;
- }
-
- @Override
- public List getCustomer() {
-
- return (List) customerDAO.findAll();
- }
-
- @Override
- public Customer getCustomerDetail(Long id) throws ManagedException {
-
- Optional customerData = customerDAO.findById(id);
-
- if (customerData.isPresent()) {
- Customer cust1=customerDAO.getOne(id);
- return cust1;
-
- } else
-
- {
- throw new ManagedException("not found!!");
- }
-
- }
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/GoodsService.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/GoodsService.java
deleted file mode 100644
index dd268389..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/GoodsService.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.List;
-import com.training.springbootjpa.model.Goods;
-
-public interface GoodsService {
-
- Goods addGoods(Goods goods);
-
- public List deleteGoodsById(long deleteById);
-
- public Goods updateGoodsById(long updateById);
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/GoodsServiceImpl.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/GoodsServiceImpl.java
deleted file mode 100644
index 45b4ce39..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/GoodsServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Optional;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.training.springbootjpa.model.Goods;
-import com.training.springbootjpa.repository.GoodsDAO;
-
-/**
- * @author RamDAfale
- *
- */
-@Service("goodsService")
-public class GoodsServiceImpl implements GoodsService {
-
- @Autowired
- private GoodsDAO goodsDAO;
-
- @Override
- public Goods addGoods(Goods goods) {
- Goods goodsData = goodsDAO.save(goods);
- return goodsData;
- }
-
- @Override
- public List deleteGoodsById(long deleteById) {
- List goodsList = goodsDAO.findAll();
- Iterator iterator = goodsList.iterator();
- while (iterator.hasNext()) {
- Goods goods = (Goods) iterator.next();
- if (goods.getGoodsId() == deleteById) {
- goodsDAO.deleteById(deleteById);
- }
- }
- return goodsList;
- }
-
- @Override
- public Goods updateGoodsById(long updateById) {
- Optional goods = goodsDAO.findById(updateById);
- Goods goodsDummy = goods.get();
- goodsDummy.setGoodsPrice(1021.12);
- return goodsDummy;
- }
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/RetailerService.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/RetailerService.java
deleted file mode 100644
index 8fe6025f..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/RetailerService.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.List;
-
-import com.training.springbootjpa.model.Retailer;
-
-public interface RetailerService {
-
- public Retailer addRetailer(Retailer retailer);
-
- public List deleteRetailerById(long deleteById);
-
- public Retailer updateRetailerById(long updateById);
-
-
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/RetailerServiceImpl.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/RetailerServiceImpl.java
deleted file mode 100644
index bad09c2a..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/RetailerServiceImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Optional;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.training.springbootjpa.model.Retailer;
-import com.training.springbootjpa.repository.RetailerDAO;
-
-@Service("retailerService")
-public class RetailerServiceImpl implements RetailerService {
-
- @Autowired
- private RetailerDAO retailerDAO;
-
- @Override
- public Retailer addRetailer(Retailer retailer) {
- Retailer retailerData = retailerDAO.save(retailer);
- return retailerData;
- }
-
- @Override
- public List deleteRetailerById(long deleteById) {
- List retailerList = retailerDAO.findAll();
- Iterator iterator = retailerList.iterator();
- while (iterator.hasNext()) {
- Retailer retailer = (Retailer) iterator.next();
- if (retailer.getRetailerId() == deleteById) {
- retailerDAO.deleteById(deleteById);
- }
- }
- return retailerList;
- }
-
- @Override
- public Retailer updateRetailerById(long updateById) {
- Optional retailer = retailerDAO.findById(updateById);
- Retailer retailerDummy = retailer.get();
- retailerDummy.setRetailerAddress("Changed Address at Winterfell");
- return retailerDummy;
- }
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/SupplierService.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/SupplierService.java
deleted file mode 100644
index 55213cfb..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/SupplierService.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.List;
-import com.training.springbootjpa.model.Supplier;
-
-public interface SupplierService {
-
- public Supplier addSupplier(Supplier supplier);
-
- public List deleteSupplierById(long deleteById);
-
- public Supplier updateSupplierById(long updateById);
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/SupplierServiceImpl.java b/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/SupplierServiceImpl.java
deleted file mode 100644
index ecec5b91..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/java/com/training/springbootjpa/service/SupplierServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.training.springbootjpa.service;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Optional;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.training.springbootjpa.model.Supplier;
-import com.training.springbootjpa.repository.SupplierDAO;
-
-@Service("supplierService")
-public class SupplierServiceImpl implements SupplierService {
-
- @Autowired
- private SupplierDAO supplierDAO;
-
- @Override
- public Supplier addSupplier(Supplier supplier) {
- Supplier supplierData = supplierDAO.save(supplier);
- return supplierData;
- }
-
- @Override
- public List deleteSupplierById(long deleteById) {
- List supplierList = supplierDAO.findAll();
- Iterator iterator = supplierList.iterator();
- while (iterator.hasNext()) {
- Supplier supplier = (Supplier) iterator.next();
- if (supplier.getSupplierId() == deleteById) {
- supplierDAO.deleteById(deleteById);
- }
- }
- return supplierList;
- }
-
- @Override
- public Supplier updateSupplierById(long updateById) {
- Optional supplier = supplierDAO.findById(updateById);
- Supplier supplierDummy = supplier.get();
- supplierDummy.setQuantityOrder(123);
- return supplierDummy;
- }
-
-}
diff --git a/15springBootJPACallingFromMainMethod/src/main/resources/application.properties b/15springBootJPACallingFromMainMethod/src/main/resources/application.properties
deleted file mode 100644
index e579783a..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/resources/application.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-spring.jpa.show-sql=true
-spring.jpa.hibernate.ddl-auto=update
-spring.h2.console.enabled=true
-spring.datasource.url=jdbc:h2:~/test;DB_CLOSE_ON_EXIT=FALSE
-
diff --git a/15springBootJPACallingFromMainMethod/src/main/resources/banner.txt b/15springBootJPACallingFromMainMethod/src/main/resources/banner.txt
deleted file mode 100644
index 4a6da677..00000000
--- a/15springBootJPACallingFromMainMethod/src/main/resources/banner.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-spring.banner.location=classpath:/src/main/resources/bannername.txt
-
-
-
-
-
-${Ansi.GREEN} _ __ _
-${Ansi.GREEN} /\/\ ___ _ __ ___ ___ _ __ _ _ _ __ ___ | |_ / _| ___ _ _ _ __ __| | ___ ___ _ __ ___
-${Ansi.GREEN} / \ / _ \ '_ ` _ \ / _ \| '__| | | | '_ \ / _ \| __| |_ / _ \| | | | '_ \ / _` | / __/ _ \| '_ ` _ \
-${Ansi.GREEN} / /\/\ \ __/ | | | | | (_) | | | |_| | | | | (_) | |_| _| (_) | |_| | | | | (_| || (_| (_) | | | | | |
-${Ansi.GREEN} \/ \/\___|_| |_| |_|\___/|_| \__, |_| |_|\___/ \__|_| \___/ \__,_|_| |_|\__,_(_)___\___/|_| |_| |_|
-${Ansi.GREEN}
-
-
-${Ansi.RED} :: Spring Boot${spring-boot.formatted-version} :: ${Ansi.DEFAULT}
\ No newline at end of file
diff --git a/15springBootJPACallingFromMainMethod/src/test/java/com/training/springbootjpa/SpringbootjpaApplicationTests.java b/15springBootJPACallingFromMainMethod/src/test/java/com/training/springbootjpa/SpringbootjpaApplicationTests.java
deleted file mode 100644
index 6ba1f55f..00000000
--- a/15springBootJPACallingFromMainMethod/src/test/java/com/training/springbootjpa/SpringbootjpaApplicationTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.training.springbootjpa;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import com.training.springbootjpa.controller.MainController;
-import com.training.springbootjpa.model.Customer;
-import com.training.springbootjpa.service.CustomerServiceImpl;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class SpringbootjpaApplicationTests {
-
-
-
-
-
-/* @Autowired
- CustomerServiceImpl mc;
-
-
- @Test
- public void testFindByCategory() {
- List books = mc.
- assertEquals(1, books.size());
-
- for (Customer book : books) {
- assertEquals(this.book.getCategory().getId(), category.getId());
- assertEquals(this.book.getAuthor(), book.getAuthor());
- assertEquals(this.book.getDescription(), book.getDescription());
- assertEquals(this.book.getIsbn(), book.getIsbn());
- }
- }*/
-
-}
diff --git a/16BankAppSpringBootJPA/.classpath b/16BankAppSpringBootJPA/.classpath
deleted file mode 100644
index 6d7587a8..00000000
--- a/16BankAppSpringBootJPA/.classpath
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/16BankAppSpringBootJPA/.eclipse-pmd b/16BankAppSpringBootJPA/.eclipse-pmd
deleted file mode 100644
index 8c5b4482..00000000
--- a/16BankAppSpringBootJPA/.eclipse-pmd
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/16BankAppSpringBootJPA/.project b/16BankAppSpringBootJPA/.project
deleted file mode 100644
index fce9fe2c..00000000
--- a/16BankAppSpringBootJPA/.project
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
- bank
-
-
-
-
-
- org.eclipse.wst.common.project.facet.core.builder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.springframework.ide.eclipse.core.springbuilder
-
-
-
-
- org.springframework.ide.eclipse.boot.validation.springbootbuilder
-
-
-
-
- org.eclipse.m2e.core.maven2Builder
-
-
-
-
- ch.acanda.eclipse.pmd.builder.PMDBuilder
-
-
-
-
- net.sf.eclipsecs.core.CheckstyleBuilder
-
-
-
-
-
- org.springframework.ide.eclipse.core.springnature
- org.eclipse.jdt.core.javanature
- org.eclipse.m2e.core.maven2Nature
- org.eclipse.wst.common.project.facet.core.nature
- ch.acanda.eclipse.pmd.builder.PMDNature
- net.sf.eclipsecs.core.CheckstyleNature
-
-
diff --git a/16BankAppSpringBootJPA/.settings/org.eclipse.core.resources.prefs b/16BankAppSpringBootJPA/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 839d647e..00000000
--- a/16BankAppSpringBootJPA/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-eclipse.preferences.version=1
-encoding//src/main/java=UTF-8
-encoding//src/main/resources=UTF-8
-encoding//src/test/java=UTF-8
-encoding/=UTF-8
diff --git a/16BankAppSpringBootJPA/.settings/org.eclipse.jdt.core.prefs b/16BankAppSpringBootJPA/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 714351ae..00000000
--- a/16BankAppSpringBootJPA/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.8
diff --git a/16BankAppSpringBootJPA/.settings/org.eclipse.wst.common.project.facet.core.xml b/16BankAppSpringBootJPA/.settings/org.eclipse.wst.common.project.facet.core.xml
deleted file mode 100644
index d8582952..00000000
--- a/16BankAppSpringBootJPA/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/16BankAppSpringBootJPA/.settings/org.springframework.ide.eclipse.prefs b/16BankAppSpringBootJPA/.settings/org.springframework.ide.eclipse.prefs
deleted file mode 100644
index a12794d6..00000000
--- a/16BankAppSpringBootJPA/.settings/org.springframework.ide.eclipse.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-boot.validation.initialized=true
-eclipse.preferences.version=1
diff --git a/16BankAppSpringBootJPA/bin/.settings/org.eclipse.core.resources.prefs b/16BankAppSpringBootJPA/bin/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 839d647e..00000000
--- a/16BankAppSpringBootJPA/bin/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-eclipse.preferences.version=1
-encoding//src/main/java=UTF-8
-encoding//src/main/resources=UTF-8
-encoding//src/test/java=UTF-8
-encoding/=UTF-8
diff --git a/16BankAppSpringBootJPA/bin/.settings/org.eclipse.jdt.core.prefs b/16BankAppSpringBootJPA/bin/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 714351ae..00000000
--- a/16BankAppSpringBootJPA/bin/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.8
diff --git a/16BankAppSpringBootJPA/bin/.settings/org.eclipse.wst.common.project.facet.core.xml b/16BankAppSpringBootJPA/bin/.settings/org.eclipse.wst.common.project.facet.core.xml
deleted file mode 100644
index d8582952..00000000
--- a/16BankAppSpringBootJPA/bin/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/16BankAppSpringBootJPA/bin/.settings/org.springframework.ide.eclipse.prefs b/16BankAppSpringBootJPA/bin/.settings/org.springframework.ide.eclipse.prefs
deleted file mode 100644
index a12794d6..00000000
--- a/16BankAppSpringBootJPA/bin/.settings/org.springframework.ide.eclipse.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-boot.validation.initialized=true
-eclipse.preferences.version=1
diff --git a/16BankAppSpringBootJPA/bin/mvnw b/16BankAppSpringBootJPA/bin/mvnw
deleted file mode 100644
index 5bf251c0..00000000
--- a/16BankAppSpringBootJPA/bin/mvnw
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/16BankAppSpringBootJPA/bin/mvnw.cmd b/16BankAppSpringBootJPA/bin/mvnw.cmd
deleted file mode 100644
index 019bd74d..00000000
--- a/16BankAppSpringBootJPA/bin/mvnw.cmd
+++ /dev/null
@@ -1,143 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/16BankAppSpringBootJPA/bin/pom.xml b/16BankAppSpringBootJPA/bin/pom.xml
deleted file mode 100644
index 77e0a5df..00000000
--- a/16BankAppSpringBootJPA/bin/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
- 4.0.0
-
- com.springboot
- bank
- 0.0.1-SNAPSHOT
- jar
-
- bank
- Demo project for Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.2.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- mysql
- mysql-connector-java
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/BankApplication.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/BankApplication.class
deleted file mode 100644
index 83bc78b5..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/BankApplication.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/controller/BankController.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/controller/BankController.class
deleted file mode 100644
index 11b28f13..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/controller/BankController.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/model/ATM.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/model/ATM.class
deleted file mode 100644
index 1142c83b..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/model/ATM.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/model/Bank.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/model/Bank.class
deleted file mode 100644
index 77d3900f..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/model/Bank.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/model/Customer.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/model/Customer.class
deleted file mode 100644
index acf0309f..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/model/Customer.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/repository/BankDAO.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/repository/BankDAO.class
deleted file mode 100644
index f296085c..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/repository/BankDAO.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/repository/CustomerDAO.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/repository/CustomerDAO.class
deleted file mode 100644
index 85a53f04..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/repository/CustomerDAO.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/BankService.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/BankService.class
deleted file mode 100644
index 128ab942..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/BankService.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/BankServiceImpl.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/BankServiceImpl.class
deleted file mode 100644
index 9eafc70d..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/BankServiceImpl.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/CustomerService.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/CustomerService.class
deleted file mode 100644
index 8ac7b74c..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/CustomerService.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/CustomerServiceImpl.class b/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/CustomerServiceImpl.class
deleted file mode 100644
index c5be0e25..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/main/java/com/springboot/bank/service/CustomerServiceImpl.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/src/main/resources/application.properties b/16BankAppSpringBootJPA/bin/src/main/resources/application.properties
deleted file mode 100644
index 359e7982..00000000
--- a/16BankAppSpringBootJPA/bin/src/main/resources/application.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-<<<<<<< HEAD
-spring.datasource.url= jdbc:mysql://localhost:3306/sys
-spring.datasource.username=root
-spring.datasource.password=root
-spring.jpa.show-sql=true
-spring.jpa.hibernate.ddl-auto=update
-=======
-spring.datasource.url= jdbc:mysql://localhost:3306/sys
-spring.datasource.username=root
-spring.datasource.password=root
-spring.jpa.show-sql=true
-spring.jpa.hibernate.ddl-auto=update
->>>>>>> a53b592d6e45294abf4d2c1a52bb4a8929e5f30e
diff --git a/16BankAppSpringBootJPA/bin/src/test/java/com/springboot/bank/BankApplicationTests.class b/16BankAppSpringBootJPA/bin/src/test/java/com/springboot/bank/BankApplicationTests.class
deleted file mode 100644
index 9bf1c99f..00000000
Binary files a/16BankAppSpringBootJPA/bin/src/test/java/com/springboot/bank/BankApplicationTests.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/bin/target/classes/META-INF/MANIFEST.MF b/16BankAppSpringBootJPA/bin/target/classes/META-INF/MANIFEST.MF
deleted file mode 100644
index 7af7641a..00000000
--- a/16BankAppSpringBootJPA/bin/target/classes/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-<<<<<<< HEAD
-Manifest-Version: 1.0
-Implementation-Title: bank
-Implementation-Version: 0.0.1-SNAPSHOT
-Built-By: Lohit
-Implementation-Vendor-Id: com.springboot
-Build-Jdk: 1.8.0_121
-Implementation-URL: https://projects.spring.io/spring-boot/#/spring-bo
- ot-starter-parent/bank
-Created-By: Maven Integration for Eclipse
-
-=======
-Manifest-Version: 1.0
-Implementation-Title: bank
-Implementation-Version: 0.0.1-SNAPSHOT
-Built-By: Lohit
-Implementation-Vendor-Id: com.springboot
-Build-Jdk: 1.8.0_121
-Implementation-URL: https://projects.spring.io/spring-boot/#/spring-bo
- ot-starter-parent/bank
-Created-By: Maven Integration for Eclipse
-
->>>>>>> a53b592d6e45294abf4d2c1a52bb4a8929e5f30e
diff --git a/16BankAppSpringBootJPA/bin/target/classes/META-INF/maven/com.springboot/bank/pom.properties b/16BankAppSpringBootJPA/bin/target/classes/META-INF/maven/com.springboot/bank/pom.properties
deleted file mode 100644
index ac4821f3..00000000
--- a/16BankAppSpringBootJPA/bin/target/classes/META-INF/maven/com.springboot/bank/pom.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-<<<<<<< HEAD
-#Generated by Maven Integration for Eclipse
-#Thu May 17 10:00:13 IST 2018
-version=0.0.1-SNAPSHOT
-groupId=com.springboot
-m2e.projectName=bank
-m2e.projectLocation=C\:\\Users\\Lohit\\Desktop\\bank
-artifactId=bank
-=======
-#Generated by Maven Integration for Eclipse
-#Wed May 16 18:21:54 IST 2018
-version=0.0.1-SNAPSHOT
-groupId=com.springboot
-m2e.projectName=bank
-m2e.projectLocation=C\:\\Users\\Lohit\\Desktop\\bank
-artifactId=bank
->>>>>>> a53b592d6e45294abf4d2c1a52bb4a8929e5f30e
diff --git a/16BankAppSpringBootJPA/bin/target/classes/META-INF/maven/com.springboot/bank/pom.xml b/16BankAppSpringBootJPA/bin/target/classes/META-INF/maven/com.springboot/bank/pom.xml
deleted file mode 100644
index 77e0a5df..00000000
--- a/16BankAppSpringBootJPA/bin/target/classes/META-INF/maven/com.springboot/bank/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
- 4.0.0
-
- com.springboot
- bank
- 0.0.1-SNAPSHOT
- jar
-
- bank
- Demo project for Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.2.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- mysql
- mysql-connector-java
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
diff --git a/16BankAppSpringBootJPA/bin/target/classes/application.properties b/16BankAppSpringBootJPA/bin/target/classes/application.properties
deleted file mode 100644
index 359e7982..00000000
--- a/16BankAppSpringBootJPA/bin/target/classes/application.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-<<<<<<< HEAD
-spring.datasource.url= jdbc:mysql://localhost:3306/sys
-spring.datasource.username=root
-spring.datasource.password=root
-spring.jpa.show-sql=true
-spring.jpa.hibernate.ddl-auto=update
-=======
-spring.datasource.url= jdbc:mysql://localhost:3306/sys
-spring.datasource.username=root
-spring.datasource.password=root
-spring.jpa.show-sql=true
-spring.jpa.hibernate.ddl-auto=update
->>>>>>> a53b592d6e45294abf4d2c1a52bb4a8929e5f30e
diff --git a/16BankAppSpringBootJPA/mvnw b/16BankAppSpringBootJPA/mvnw
deleted file mode 100644
index 5bf251c0..00000000
--- a/16BankAppSpringBootJPA/mvnw
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/16BankAppSpringBootJPA/mvnw.cmd b/16BankAppSpringBootJPA/mvnw.cmd
deleted file mode 100644
index 019bd74d..00000000
--- a/16BankAppSpringBootJPA/mvnw.cmd
+++ /dev/null
@@ -1,143 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/16BankAppSpringBootJPA/pom.xml b/16BankAppSpringBootJPA/pom.xml
deleted file mode 100644
index d09d388b..00000000
--- a/16BankAppSpringBootJPA/pom.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
- 4.0.0
-
- com.springboot
- bank
- 0.0.1-SNAPSHOT
- jar
-
- MyBankDemo
- project for Bank Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.2.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- mysql
- mysql-connector-java
-
-
-
- log4j
- log4j
- 1.2.17
-
-
-
- org.mockito
- mockito-all
- 1.9.5
- test
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/BankApplication.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/BankApplication.java
deleted file mode 100644
index 1387b62c..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/BankApplication.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.springboot.bank;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class BankApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(BankApplication.class, args);
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/ATMController.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/ATMController.java
deleted file mode 100644
index cc655e51..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/ATMController.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.controller;
-
-import java.math.BigDecimal;
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.springboot.bank.dto.ATMDetails;
-import com.springboot.bank.dto.WrapperBankATM;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.ATM;
-import com.springboot.bank.service.ATMService;
-
-/**
- * @author Ram
- *
- */
-
-@RestController
-public class ATMController {
-
- final Logger LOGGER = Logger.getLogger(ATMController.class);
-
- @Autowired
- ATMService atmService;
-
- @PostMapping(value = "/createATM")
- public ResponseEntity createATM(@RequestBody WrapperBankATM wrapperBankATM) throws BankException {
- ATM atmData = null;
- try {
- atmData = atmService.createATM(wrapperBankATM);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (atmData == null)
- throw new BankException("atm details not added");
- else
- return new ResponseEntity(atmData, HttpStatus.OK);
- }
-
- @PostMapping(value = "/addMoney/{atmId}/{bankId}/{moneyToBeAddedToATM}")
- public ResponseEntity addMoneyFromBank(@PathVariable Long atmId, @PathVariable Long bankId,
- @PathVariable BigDecimal moneyToBeAddedToATM) throws BankException {
- ATM atmData = null;
- try {
- atmData = atmService.addMoneyFromBank(atmId, bankId, moneyToBeAddedToATM);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (atmData == null)
- throw new BankException("atm details not added");
- else
- return new ResponseEntity(atmData, HttpStatus.OK);
- }
-
- @PostMapping(value = "/withdrawMoneyFromATM")
- public ResponseEntity withdrawMoney(@RequestBody ATMDetails atmDetails) throws BankException {
- ATM atmData = null;
- try {
- atmData = atmService.withdrawMoney(atmDetails);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (atmData == null)
- throw new BankException("atm details not added");
- else
- return new ResponseEntity(atmData, HttpStatus.OK);
- }
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/AccountController.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/AccountController.java
deleted file mode 100644
index 80278422..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/AccountController.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.controller;
-
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.springboot.bank.dto.AccountDetails;
-import com.springboot.bank.dto.WrapperBankCustomerAccount;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Account;
-import com.springboot.bank.service.AccountService;
-
-/**
- * @author Ram
- *
- */
-
-@RestController
-public class AccountController {
-
- @Autowired
- AccountService accountService;
-
- final Logger LOGGER = Logger.getLogger(AccountController.class);
-
- @PostMapping(value = "/createAccount")
- public ResponseEntity createAccount(@RequestBody WrapperBankCustomerAccount wrapperBankCustomerAccount)
- throws BankException {
- Account accountData = null;
- try {
- accountData = accountService.createAccount(wrapperBankCustomerAccount);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (accountData == null)
- throw new BankException("Account details not added");
- else
- return new ResponseEntity(accountData, HttpStatus.OK);
- }
-
- @PostMapping(value = "/depositMoney")
- public ResponseEntity depositMoney(@RequestBody AccountDetails accountDetails) throws BankException {
- Account accountData = null;
- try {
- accountData = accountService.depositMoney(accountDetails);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (accountData == null)
- throw new BankException("Account details not found");
- else
- return new ResponseEntity(accountData, HttpStatus.OK);
- }
-
- @PostMapping(value = "/withdrawMoneyFromAccount")
- public ResponseEntity withdrawMoney(@RequestBody AccountDetails accountDetails) throws BankException {
- Account accountData = null;
- try {
- accountData = accountService.withdrawMoney(accountDetails);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (accountData == null)
- throw new BankException("Account details not found");
- else
- return new ResponseEntity(accountData, HttpStatus.OK);
- }
-
- @PostMapping(value = "/viewAccount/{accountId}")
- public ResponseEntity getAccountDetails(@PathVariable Long accountId) throws BankException {
- Account accountData = null;
- try {
- accountData = accountService.getAccountDetails(accountId);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (accountData == null)
- throw new BankException("Account details not found");
- else
- return new ResponseEntity(accountData, HttpStatus.OK);
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/BankController.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/BankController.java
deleted file mode 100644
index 553325e0..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/BankController.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.controller;
-
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Bank;
-import com.springboot.bank.service.BankService;
-
-/**
- * @author Ram
- *
- */
-
-@RestController
-public class BankController {
-
- final Logger LOGGER = Logger.getLogger(BankController.class);
-
- @Autowired
- private BankService bankService;
-
- @PostMapping(value = "/createBank")
- public ResponseEntity addBank(@RequestBody Bank bank) throws BankException {
- Bank bankData = null;
- try {
- bankData = bankService.createBank(bank);
- } catch (Exception e) {
- LOGGER.error(e.getMessage());
- }
- if (bankData == null)
- throw new BankException("Bank details not added");
- else
- return new ResponseEntity(bankData, HttpStatus.OK);
- }
-
- @GetMapping(value = "/viewBankDetails/{bankId}")
- public ResponseEntity getBankDetails(@PathVariable Long bankId) throws BankException {
- Bank bank = null;
- try {
- bank = bankService.getBankDetails(bankId);
- } catch (Exception e) {
- LOGGER.error(e.getMessage());
- }
- if (bank == null)
- throw new BankException("No such Id of Bank exixts");
- else
- return new ResponseEntity(bank, HttpStatus.OK);
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/BankDenominationController.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/BankDenominationController.java
deleted file mode 100644
index d92cd677..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/BankDenominationController.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.controller;
-
-import java.util.logging.Logger;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.springboot.bank.dto.WrapperATMDenomination;
-import com.springboot.bank.dto.WrapperDenomination;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Account;
-import com.springboot.bank.model.Denomination;
-import com.springboot.bank.service.BankDenominationService;
-
-
-
-/**
- * @author Ram
- *
- */
-@RestController
-public class BankDenominationController {
-
-
- private static final Logger LOGGER = Logger.getLogger( Account.class.getName() );
-
-
- @Autowired
- BankDenominationService bankDenominationService;
-
- @PostMapping("/totalDenom")
- public ResponseEntity getTotalDenominationForBank(final @RequestBody WrapperDenomination wrapperDenomination ) throws BankException {
- final Denomination denomination = new Denomination();
- try {
- bankDenominationService.addDenominationNew(wrapperDenomination.getAmount());
- } catch (BankException e) {
- System.out.println(e.getMessage());
- LOGGER.info(e.getMessage());
- }
- if (denomination == null) {
- throw new BankException("not found");
- } else {
- return new ResponseEntity(denomination, HttpStatus.OK);
- }
- }
-
- /**
- * @param wrapperBankDenomination
- * @return
- * @throws BankException
- */
-@PostMapping("/") public ResponseEntity getTotalDenominationForATM(final @RequestBody WrapperATMDenomination wrapperATMDenomination ) throws BankException {
- final Denomination bankDenomination = new Denomination();
- try {
- bankDenominationService.addDenominationNew(wrapperATMDenomination.getAmount());
- } catch (BankException e) {
- System.out.println(e.getMessage());
- LOGGER.info(e.getMessage());
- }
- return new ResponseEntity(bankDenomination, HttpStatus.OK);
- }
-
-
-
-
-
-
-
-}
\ No newline at end of file
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/CustomerController.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/CustomerController.java
deleted file mode 100644
index f5673796..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/CustomerController.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.controller;
-
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.springboot.bank.dto.WrapperBankCustomer;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Customer;
-import com.springboot.bank.service.CustomerService;
-
-/**
- * @author Ram
- *
- */
-
-@RestController
-public class CustomerController {
-
- final Logger LOGGER = Logger.getLogger(CustomerController.class);
-
- @Autowired
- private CustomerService customerService;
-
- @PostMapping(value = "/createCustomer")
- public ResponseEntity createCustomer(@RequestBody WrapperBankCustomer wrapperBankCustomer)
- throws BankException {
- Customer customerData = null;
- try {
- customerData = customerService.createCustomer(wrapperBankCustomer);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (customerData == null)
- throw new BankException("Customer details not added");
- else
- return new ResponseEntity(customerData, HttpStatus.OK);
- }
-
- @GetMapping(value = "/viewCustomer/{customerId}")
- public ResponseEntity getCustomerDetails(@PathVariable Long customerId) throws BankException {
- Customer customerData = null;
- try {
- customerData = customerService.getCustomerDetails(customerId);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (customerData == null)
- throw new BankException("No such Id of Bank exixts");
- else
- return new ResponseEntity(customerData, HttpStatus.OK);
- }
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/TransactionController.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/TransactionController.java
deleted file mode 100644
index 28f96e7b..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/controller/TransactionController.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.controller;
-
-import java.util.Optional;
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Transaction;
-import com.springboot.bank.service.TransactionService;
-
-/**
- * @author Ram
- *
- */
-
-@RestController
-public class TransactionController {
-
- final Logger LOGGER = Logger.getLogger(TransactionController.class);
-
- @Autowired
- private TransactionService transactionService;
-
- @PostMapping(value = "/createTransaction")
- public ResponseEntity createTransaction(@RequestBody Transaction transaction) throws BankException {
- String transactionData = null;
- try {
- transactionData = transactionService.createTransaction(transaction);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (transactionData == null)
- throw new BankException("Transaction details not added");
- else
- return new ResponseEntity(transactionData, HttpStatus.OK);
- }
-
- @PostMapping(value = "/viewTransaction/{customerId}")
- public ResponseEntity> getTransactionDetails(@PathVariable Long customerId)
- throws BankException {
- Optional transactionData = null;
- try {
- transactionData = transactionService.getTransactionDetails(customerId);
- } catch (BankException e) {
- LOGGER.error(e.getMessage());
- }
- if (transactionData == null)
- throw new BankException("Transaction details not found");
- else
- return new ResponseEntity>(transactionData, HttpStatus.OK);
- }
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/ATMDetails.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/ATMDetails.java
deleted file mode 100644
index e922d99d..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/ATMDetails.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.dto;
-
-import java.math.BigDecimal;
-
-/**
- * @author Ram
- *
- */
-public class ATMDetails {
-
- private Long bankId;
- private Long atmId;
- private Long accountId;
- private BigDecimal amount;
-
- /**
- *
- */
- public ATMDetails() {
- super();
- }
-
- /**
- * @param bankId
- * @param atmId
- * @param accountId
- * @param amount
- */
- public ATMDetails(Long bankId, Long atmId, Long accountId, BigDecimal amount) {
- super();
- this.bankId = bankId;
- this.atmId = atmId;
- this.accountId = accountId;
- this.amount = amount;
- }
-
- /**
- * @return the bankId
- */
- public Long getBankId() {
- return bankId;
- }
-
- /**
- * @param bankId
- * the bankId to set
- */
- public void setBankId(Long bankId) {
- this.bankId = bankId;
- }
-
- /**
- * @return the atmId
- */
- public Long getAtmId() {
- return atmId;
- }
-
- /**
- * @param atmId
- * the atmId to set
- */
- public void setAtmId(Long atmId) {
- this.atmId = atmId;
- }
-
- /**
- * @return the accountId
- */
- public Long getAccountId() {
- return accountId;
- }
-
- /**
- * @param accountId
- * the accountId to set
- */
- public void setAccountId(Long accountId) {
- this.accountId = accountId;
- }
-
- /**
- * @return the amount
- */
- public BigDecimal getAmount() {
- return amount;
- }
-
- /**
- * @param amount
- * the amount to set
- */
- public void setAmount(BigDecimal amount) {
- this.amount = amount;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "ATMDetails [bankId=" + bankId + ", atmId=" + atmId + ", accountId=" + accountId + ", amount=" + amount
- + "]";
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/AccountDetails.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/AccountDetails.java
deleted file mode 100644
index db6299ed..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/AccountDetails.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.dto;
-
-import java.math.BigDecimal;
-
-/**
- * @author Ram
- *
- */
-public class AccountDetails {
-
- private Long bankId;
- private Long customerId;
- private Long accountId;
- private BigDecimal amount;
-
- /**
- *
- */
- public AccountDetails() {
- super();
- }
-
- /**
- * @param bankId
- * @param customerId
- * @param accountId
- * @param amountToBeAdded
- */
- public AccountDetails(Long bankId, Long customerId, Long accountId, BigDecimal amount) {
- super();
- this.bankId = bankId;
- this.customerId = customerId;
- this.accountId = accountId;
- this.amount = amount;
- }
-
- /**
- * @return the bankId
- */
- public Long getBankId() {
- return bankId;
- }
-
- /**
- * @param bankId
- * the bankId to set
- */
- public void setBankId(Long bankId) {
- this.bankId = bankId;
- }
-
- /**
- * @return the customerId
- */
- public Long getCustomerId() {
- return customerId;
- }
-
- /**
- * @param customerId
- * the customerId to set
- */
- public void setCustomerId(Long customerId) {
- this.customerId = customerId;
- }
-
- /**
- * @return the accountId
- */
- public Long getAccountId() {
- return accountId;
- }
-
- /**
- * @param accountId
- * the accountId to set
- */
- public void setAccountId(Long accountId) {
- this.accountId = accountId;
- }
-
- /**
- * @return the amountToBeAdded
- */
- public BigDecimal getAmount() {
- return amount;
- }
-
- /**
- * @param amountToBeAdded
- * the amountToBeAdded to set
- */
- public void setAmount(BigDecimal amount) {
- this.amount = amount;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "AccountDetails [bankId=" + bankId + ", customerId=" + customerId + ", accountId=" + accountId
- + ", amount=" + amount + "]";
- }
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperATMDenomination.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperATMDenomination.java
deleted file mode 100644
index 175391be..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperATMDenomination.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.dto;
-
-import com.springboot.bank.model.Denomination;
-
-/**
- * @author Ram
- *
- */
-public class WrapperATMDenomination {
-
-
-private Denomination denomination;
-
-private Integer amount;
-private Long bankId;
-private Long atmId;
-
-
- /**
- * @param denomination
- * @param amount
- * @param bankId
- * @param atmId
- */
- public WrapperATMDenomination(final Denomination denomination,final Integer amount,final Long bankId,final Long atmId) {
- this.denomination = denomination;
- this.amount = amount;
- this.bankId = bankId;
- this.atmId = atmId;
- }
- /**
- * @return the bankDenomination
- */
- public Denomination getBankDenomination() {
- return denomination;
- }
- /**
- * @param denomination the bankDenomination to set
- */
- public void setBankDenomination(final Denomination denomination) {
- this.denomination = denomination;
- }
- /**
- * @return the amount
- */
- public Integer getAmount() {
- return amount;
- }
- /**
- * @param amount the amount to set
- */
- public void setAmount(final Integer amount) {
- this.amount = amount;
- }
- /**
- * @return the bankId
- */
- public Long getBankId() {
- return bankId;
- }
- /**
- * @param bankId the bankId to set
- */
- public void setBankId(final Long bankId) {
- this.bankId = bankId;
- }
- /**
- * @return the atmId
- */
- public Long getAtmId() {
- return atmId;
- }
- /**
- * @param atmId the atmId to set
- */
- public void setAtmId(final Long atmId) {
- this.atmId = atmId;
- }
- /*
- * java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "WrapperATMDenomination [bankDenomination=" + denomination + ", amount=" + amount + ", bankId="
- + bankId + ", atmId=" + atmId + "]";
- }
-
-
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperAccountDenomination.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperAccountDenomination.java
deleted file mode 100644
index c6c1c92a..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperAccountDenomination.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.dto;
-
-import com.springboot.bank.model.BankDenomination;
-
-/**
- * @author Ram
- *
- */
-public class WrapperAccountDenomination {
-
-
- private BankDenomination bankDenomination;
- private Integer amount;
- private Long bankId;
- private Long accountId;
- /**
- * @param bankDenomination
- * @param amount
- * @param bankId
- * @param accountId
- */
- public WrapperAccountDenomination(BankDenomination bankDenomination, Integer amount, Long bankId, Long accountId) {
- this.bankDenomination = bankDenomination;
- this.amount = amount;
- this.bankId = bankId;
- this.accountId = accountId;
- }
- /**
- * @return the bankDenomination
- */
- public BankDenomination getBankDenomination() {
- return bankDenomination;
- }
- /**
- * @param bankDenomination the bankDenomination to set
- */
- public void setBankDenomination(BankDenomination bankDenomination) {
- this.bankDenomination = bankDenomination;
- }
- /**
- * @return the amount
- */
- public Integer getAmount() {
- return amount;
- }
- /**
- * @param amount the amount to set
- */
- public void setAmount(Integer amount) {
- this.amount = amount;
- }
- /**
- * @return the bankId
- */
- public Long getBankId() {
- return bankId;
- }
- /**
- * @param bankId the bankId to set
- */
- public void setBankId(Long bankId) {
- this.bankId = bankId;
- }
- /**
- * @return the accountId
- */
- public Long getAccountId() {
- return accountId;
- }
- /**
- * @param accountId the accountId to set
- */
- public void setAccountId(Long accountId) {
- this.accountId = accountId;
- }
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "WrapperAccountDenomination [bankDenomination=" + bankDenomination + ", amount=" + amount + ", bankId="
- + bankId + ", accountId=" + accountId + "]";
- }
-
-
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankATM.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankATM.java
deleted file mode 100644
index 135b0b5e..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankATM.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.dto;
-
-import com.springboot.bank.model.ATM;
-
-/**
- * @author Ram
- *
- */
-public class WrapperBankATM {
-
- ATM atm;
- Long bankId;
-
- /**
- *
- */
- public WrapperBankATM() {
- super();
- }
-
- /**
- * @param atm
- * @param bankId
- */
- public WrapperBankATM(ATM atm, Long bankId) {
- this.atm = atm;
- this.bankId = bankId;
- }
-
- /**
- * @return the atm
- */
- public ATM getAtm() {
- return atm;
- }
-
- /**
- * @param atm
- * the atm to set
- */
- public void setAtm(ATM atm) {
- this.atm = atm;
- }
-
- /**
- * @return the bankId
- */
- public Long getBankId() {
- return bankId;
- }
-
- /**
- * @param bankId
- * the bankId to set
- */
- public void setBankId(Long bankId) {
- this.bankId = bankId;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "WrapperBankATM [atm=" + atm + ", bankId=" + bankId + "]";
- }
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankCustomer.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankCustomer.java
deleted file mode 100644
index 5c1fdf31..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankCustomer.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.dto;
-
-import com.springboot.bank.model.Customer;
-
-/**
- * @author Ram
- *
- */
-public class WrapperBankCustomer {
-
- Customer customer;
- Long bankId;
-
- /**
- *
- */
- public WrapperBankCustomer() {
- super();
- }
-
- /**
- * @param customer
- * @param bankId
- */
- public WrapperBankCustomer(Customer customer, Long bankId) {
- super();
- this.customer = customer;
- this.bankId = bankId;
- }
-
- /**
- * @return the customer
- */
- public Customer getCustomer() {
- return customer;
- }
-
- /**
- * @param customer
- * the customer to set
- */
- public void setCustomer(Customer customer) {
- this.customer = customer;
- }
-
- /**
- * @return the bankId
- */
- public Long getBankId() {
- return bankId;
- }
-
- /**
- * @param bankId
- * the bankId to set
- */
- public void setBankId(Long bankId) {
- this.bankId = bankId;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "WrapperBankCustomer [customer=" + customer + ", bankId=" + bankId + "]";
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankCustomerAccount.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankCustomerAccount.java
deleted file mode 100644
index 78ab35bb..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankCustomerAccount.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.dto;
-
-import com.springboot.bank.model.Account;
-
-/**
- * @author Ram
- *
- */
-public class WrapperBankCustomerAccount {
-
- private Account account;
- private Long customerId;
- private Long bankId;
-
- /**
- *
- */
- public WrapperBankCustomerAccount() {
- super();
- }
-
- /**
- * @param account
- * @param customerId
- * @param bankId
- */
- public WrapperBankCustomerAccount(Account account, Long customerId, Long bankId) {
- super();
- this.account = account;
- this.customerId = customerId;
- this.bankId = bankId;
- }
-
- /**
- * @return the account
- */
- public Account getAccount() {
- return account;
- }
-
- /**
- * @param account
- * the account to set
- */
- public void setAccount(Account account) {
- this.account = account;
- }
-
- /**
- * @return the customerId
- */
- public Long getCustomerId() {
- return customerId;
- }
-
- /**
- * @param customerId
- * the customerId to set
- */
- public void setCustomerId(Long customerId) {
- this.customerId = customerId;
- }
-
- /**
- * @return the bankId
- */
- public Long getBankId() {
- return bankId;
- }
-
- /**
- * @param bankId
- * the bankId to set
- */
- public void setBankId(Long bankId) {
- this.bankId = bankId;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "WrapperBankCustomerAccount [account=" + account + ", customerId=" + customerId + ", bankId=" + bankId
- + "]";
- }
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankDenomination.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankDenomination.java
deleted file mode 100644
index c8144f05..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperBankDenomination.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.dto;
-
-import com.springboot.bank.model.BankDenomination;
-
-/**
- * @author Sumit
- *
- */
-public class WrapperBankDenomination {
-
- BankDenomination bankDenomination;
- Integer amount;
- Long bankId;
-
- /**
- *
- */
- public WrapperBankDenomination() {
- super();
- }
-
- /**
- * @param bankDenomination
- * @param amount
- * @param bankId
- */
- public WrapperBankDenomination(BankDenomination bankDenomination, Integer amount, Long bankId) {
- super();
- this.bankDenomination = bankDenomination;
- this.amount = amount;
- this.bankId = bankId;
- }
-
- /**
- * @return the bankDenomination
- */
- public BankDenomination getBankDenomination() {
- return bankDenomination;
- }
-
- /**
- * @param bankDenomination
- * the bankDenomination to set
- */
- public void setBankDenomination(BankDenomination bankDenomination) {
- this.bankDenomination = bankDenomination;
- }
-
- /**
- * @return the amount
- */
- public Integer getAmount() {
- return amount;
- }
-
- /**
- * @param amount
- * the amount to set
- */
- public void setAmount(Integer amount) {
- this.amount = amount;
- }
-
- /**
- * @return the bankId
- */
- public Long getBankId() {
- return bankId;
- }
-
- /**
- * @param bankId
- * the bankId to set
- */
- public void setBankId(Long bankId) {
- this.bankId = bankId;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "WrapperBankDenomination [bankDenomination=" + bankDenomination + ", amount=" + amount + ", bankId="
- + bankId + "]";
- }
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperDenomination.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperDenomination.java
deleted file mode 100644
index 6a59e423..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/dto/WrapperDenomination.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.dto;
-
-import com.springboot.bank.model.Denomination;
-
-/**
- * @author Ram
- *
- */
-public class WrapperDenomination {
-
- private Denomination denomination;
- private Integer amount;
- private Long bankId;
-
-
- /**
- * Default constructor
- */
- public WrapperDenomination() {
- super();
- }
-
- /**
- * @param denomination
- * @param amount
- * @param bankId
- */
- public WrapperDenomination(Denomination denomination, Integer amount, Long bankId) {
- super();
- this.denomination = denomination;
- this.amount = amount;
- this.bankId = bankId;
- }
-
- /**
- * @return the denomination
- */
- public Denomination getDenomination() {
- return denomination;
- }
-
- /**
- * @param denomination the denomination to set
- */
- public void setDenomination(Denomination denomination) {
- this.denomination = denomination;
- }
-
- /**
- * @return the amount
- */
- public Integer getAmount() {
- return amount;
- }
-
- /**
- * @param amount the amount to set
- */
- public void setAmount(Integer amount) {
- this.amount = amount;
- }
-
- /**
- * @return the bankId
- */
- public Long getBankId() {
- return bankId;
- }
-
- /**
- * @param bankId the bankId to set
- */
- public void setBankId(Long bankId) {
- this.bankId = bankId;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "WrapperDenomination [denomination=" + denomination + ", amount=" + amount + ", bankId=" + bankId + "]";
- }
-
-
-
-
-
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/exception/BankException.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/exception/BankException.java
deleted file mode 100644
index ec3a048c..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/exception/BankException.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.exception;
-
-/**
- * @author Ram
- *
- */
-public class BankException extends Exception {
-
- public BankException(String message) {
- super(message);
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/ATM.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/ATM.java
deleted file mode 100644
index 2ad91cd7..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/ATM.java
+++ /dev/null
@@ -1,99 +0,0 @@
-
-/**
- *
- */
-package com.springboot.bank.model;
-
-import java.math.BigDecimal;
-import java.util.logging.Logger;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-/**
- * @author Ram
- *It will represents the ATM entity
- */
-@Entity
-@Table(name = "atm")
-public class ATM {
-
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long atmId;
- // @Required
- private BigDecimal money;
- @ManyToOne(targetEntity = Bank.class)
- private Bank bank;
-
- private static final Logger LOGGER = Logger.getLogger( ATM.class.getName() );
-
- /**
- *
- */
- public ATM() {
- super();
- }
-
- /**
- * @param atmId
- * @param money
- * @param bank
- */
- public ATM(BigDecimal money, Bank bank) {
- this.money = money;
- this.bank = bank;
- LOGGER.info("Inside the ATM Entity");
-
- }
-
- /**
- * @return the atmId
- */
- public Long getAtmId() {
- return atmId;
- }
-
- /**
- * @param atmId
- * the atmId to set
- */
- public void setAtmId(Long atmId) {
- this.atmId = atmId;
- }
-
- /**
- * @return the money
- */
- public BigDecimal getMoney() {
- return money;
- }
-
- /**
- * @param money
- * the money to set
- */
- public void setMoney(BigDecimal money) {
- this.money = money;
- }
-
- /**
- * @param bank
- * the bank to set
- */
- public void setBank(Bank bank) {
- this.bank = bank;
- }
-
- /*
- * @return toString() representation of given object
- */
- @Override
- public String toString() {
- return "ATM [atmId=" + atmId + ", money=" + money + ", bank=" + bank + "]";
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Account.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Account.java
deleted file mode 100644
index 6ab70cfb..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Account.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.model;
-
-import java.math.BigDecimal;
-import java.util.logging.Logger;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-/**
- * @author Ram It will represents the Account Entity.
- */
-@Entity
-@Table(name = "account")
-public class Account {
-
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long accountId;
- @ManyToOne(targetEntity = Bank.class)
- private Bank bank;
- @ManyToOne(targetEntity = Customer.class)
- private Customer customer;
- private BigDecimal amount;
-
- /*
- * @Entity This is logger used instead of Sysout.
- */
- private static final Logger LOGGER = Logger.getLogger(Account.class.getName());
-
- /**
- *
- */
- public Account() {
- super();
- }
-
- /**
- * @param accountId
- * acted as primary key of the table account
- * @param bank
- * @param customer
- * @param amount
- */
- public Account(final Bank bank, final Customer customer, final BigDecimal amount) {
- this.bank = bank;
- this.customer = customer;
- this.amount = amount;
- LOGGER.info("Inside the account Entity");
- }
-
- /**
- * @return the accountId
- */
- public Long getAccountId() {
- return accountId;
- }
-
- /**
- * @param accountId
- * the accountId to set
- */
- public void setAccountId(final Long accountId) {
- this.accountId = accountId;
- }
-
- /**
- * @return the bank
- */
- public Bank getBank() {
- return bank;
- }
-
- /**
- * @param bank
- * the bank to set
- */
- public void setBank(final Bank bank) {
- this.bank = bank;
- }
-
- /**
- * @return the customer
- */
- public Customer getCustomer() {
- return customer;
- }
-
- /**
- * @param customer
- * the customer to set
- */
- public void setCustomer(final Customer customer) {
- this.customer = customer;
- }
-
- /**
- * @return the amount
- */
- public BigDecimal getAmount() {
- return amount;
- }
-
- /**
- * @param amount
- * the amount to set
- */
- public void setAmount(final BigDecimal amount) {
- this.amount = amount;
- }
-
- /*
- * @return toString() representation of given object
- */
- @Override
- public String toString() {
- return "Account [accountId=" + accountId + ", bank=" + bank + ", customer=" + customer + ", amount=" + amount
- + "]";
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Bank.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Bank.java
deleted file mode 100644
index 4f9760a8..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Bank.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.model;
-
-import java.math.BigDecimal;
-import java.util.logging.Logger;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * @author Ram
- *It will represents the BANK entity
- */
-@Table(name = "bank")
-@Entity
-public class Bank {
-
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Column(name = "bankId")
- private Long bankId;
- private BigDecimal amount;
-
- private static final Logger LOGGER = Logger.getLogger( Bank.class.getName() );
-
-
- /**
- *
- */
- public Bank() {
- super();
- }
-
- /**
- * @param bankId
- * @param amount
- */
- public Bank(BigDecimal amount) {
- this.amount = amount;
- LOGGER.info("Inside the BAnk Entity");
- }
-
- /**
- * @return the bankId
- */
- public Long getBankId() {
- return bankId;
- }
-
- /**
- * @param bankId
- * the bankId to set
- */
- public void setBankId(Long bankId) {
- this.bankId = bankId;
- }
-
- /**
- * @return the amount
- */
- public BigDecimal getAmount() {
- return amount;
- }
-
- /**
- * @param amount
- * the amount to set
- */
- public void setAmount(BigDecimal amount) {
- this.amount = amount;
- }
-
- /*
- * @return toString() representation of given object
- */
- @Override
- public String toString() {
- return "Bank [bankId=" + bankId + ", amount=" + amount + "]";
- }
-}
\ No newline at end of file
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/BankDenomination.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/BankDenomination.java
deleted file mode 100644
index 01ec788f..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/BankDenomination.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.model;
-
-import java.util.logging.Logger;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.OneToOne;
-
-/**
- * @author Sumit
- *
- */
-
-@Entity
-public class BankDenomination {
-
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long denominationId;
- @OneToOne(targetEntity = Bank.class)
- private Bank bank;
- private Integer noOfDenomination;
- private Integer denomination;
-
-
- private static final Logger LOGGER = Logger.getLogger( ATM.class.getName() );
- /**
- *
- */
- public BankDenomination() {
-
- super();
- LOGGER.info("Inside the BankDenomination Entity");
- }
-
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "BankDenominationNew [denominationId=" + denominationId + ", bank=" + bank + ", noOfDenomination="
- + noOfDenomination + ", denomination=" + denomination + "]";
- }
-
-
-
- /**
- * @return the denominationId
- */
- public Long getDenominationId() {
- return denominationId;
- }
-
- /**
- * @param denominationId
- * the denominationId to set
- */
- public void setDenominationId(Long denominationId) {
- this.denominationId = denominationId;
- }
-
- /**
- * @return the bank
- */
- public Bank getBank() {
- return bank;
- }
-
- /**
- * @param bank
- * the bank to set
- */
- public void setBank(Bank bank) {
- this.bank = bank;
- }
-
-
- /**
- * @return the noOfDenomination
- */
- public Integer getNoOfDenomination() {
- return noOfDenomination;
- }
-
- /**
- * @param noOfDenomination
- * the noOfDenomination to set
- */
- public void setNoOfDenomination(Integer noOfDenomination) {
- this.noOfDenomination = noOfDenomination;
- }
-
-
-
- /**
- * @return the denomination
- */
- public Integer getDenomination() {
- return denomination;
- }
-
-
-
- /**
- * @param denomination the denomination to set
- */
- public void setDenomination(Integer denomination) {
- this.denomination = denomination;
- }
-
-
-
- /**
- * @param denominationId
- * @param bank
- * @param noOfDenomination
- * @param denomination
- */
- public BankDenomination(Long denominationId, Bank bank, Integer noOfDenomination, Integer denomination) {
- super();
- this.denominationId = denominationId;
- this.bank = bank;
- this.noOfDenomination = noOfDenomination;
- this.denomination = denomination;
- }
-
-
-
-}
\ No newline at end of file
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Customer.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Customer.java
deleted file mode 100644
index 2aefddb4..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Customer.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.model;
-
-import java.util.logging.Logger;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import org.springframework.lang.NonNull;
-
-/**
- * @author Ram
- *It will represents the CUstomer Entity.
- */
-
-@Entity
-@Table(name = "customer")
-public class Customer {
-
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long customerId;
- @Column(nullable = false, length = 100)
- private String customerName;
- @NonNull
- private Integer customerPin;
- @ManyToOne(targetEntity = Bank.class)
- private Bank bank;
-
- private static final Logger LOGGER = Logger.getLogger( Customer.class.getName() );
-
-
- // @JoinTable(name = "bank_customer", joinColumns = @JoinColumn(name =
- // "customerId"), inverseJoinColumns = @JoinColumn(name = "bankId"))
-
- /**
- *
- */
- public Customer() {
- super();
- }
-
- /**
- * @param customerId
- * @param customerName
- * @param customerPin
- * @param bank
- */
- public Customer( String customerName, Integer customerPin, Bank bank) {
- this.customerName = customerName;
- this.customerPin = customerPin;
- this.bank = bank;
- LOGGER.info("Inside the Customer Entity");
-
- }
-
- /**
- * @return the customerId
- */
- public Long getCustomerId() {
- return customerId;
- }
-
- /**
- * @param customerId
- * the customerId to set
- */
- public void setCustomerId(Long customerId) {
- this.customerId = customerId;
- }
-
- /**
- * @return the customerName
- */
- public String getCustomerName() {
- return customerName;
- }
-
- /**
- * @param customerName
- * the customerName to set
- */
- public void setCustomerName(String customerName) {
- this.customerName = customerName;
- }
-
- /**
- * @return the customerPin
- */
- public Integer getCustomerPin() {
- return customerPin;
- }
-
- /**
- * @param customerPin
- * the customerPin to set
- */
- public void setCustomerPin(Integer customerPin) {
- this.customerPin = customerPin;
- }
-
- /**
- * @return the bank
- */
- public Bank getBank() {
- return bank;
- }
-
- /**
- * @param bank
- * the bank to set
- */
- public void setBank(Bank bank) {
- this.bank = bank;
- }
-
- /*
- * @return toString() representation of given object
- */
- @Override
- public String toString() {
- return "Customer [customerId=" + customerId + ", customerName=" + customerName + ", customerPin=" + customerPin
- + ", bank=" + bank + "]";
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Denomination.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Denomination.java
deleted file mode 100644
index a404f01b..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Denomination.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.model;
-
-import java.util.logging.Logger;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.OneToOne;
-
-/**
- * @author Ram
- *
- */
-
-@Entity
-public class Denomination {
-
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long denominationId;
- @OneToOne(targetEntity = Bank.class)
- private Bank bank;
- private Integer noOfDenomination;
- private Integer denomination;
-
-
- private static final Logger LOGGER = Logger.getLogger( Denomination.class.getName() );
- /**
- *
- */
- public Denomination() {
-
- super();
- LOGGER.info("Inside the BankDenomination Entity");
- }
-
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "BankDenominationNew [denominationId=" + denominationId + ", bank=" + bank + ", noOfDenomination="
- + noOfDenomination + ", denomination=" + denomination + "]";
- }
-
-
-
- /**
- * @return the denominationId
- */
- public Long getDenominationId() {
- return denominationId;
- }
-
- /**
- * @param denominationId
- * the denominationId to set
- */
- public void setDenominationId(Long denominationId) {
- this.denominationId = denominationId;
- }
-
- /**
- * @return the bank
- */
- public Bank getBank() {
- return bank;
- }
-
- /**
- * @param bank
- * the bank to set
- */
- public void setBank(Bank bank) {
- this.bank = bank;
- }
-
-
- /**
- * @return the noOfDenomination
- */
- public Integer getNoOfDenomination() {
- return noOfDenomination;
- }
-
- /**
- * @param noOfDenomination
- * the noOfDenomination to set
- */
- public void setNoOfDenomination(Integer noOfDenomination) {
- this.noOfDenomination = noOfDenomination;
- }
-
-
-
- /**
- * @return the denomination
- */
- public Integer getDenomination() {
- return denomination;
- }
-
-
-
- /**
- * @param denomination the denomination to set
- */
- public void setDenomination(Integer denomination) {
- this.denomination = denomination;
- }
-
-
-
- /**
- * @param denominationId
- * @param bank
- * @param noOfDenomination
- * @param denomination
- */
- public Denomination(Long denominationId, Bank bank, Integer noOfDenomination, Integer denomination) {
- super();
- this.denominationId = denominationId;
- this.bank = bank;
- this.noOfDenomination = noOfDenomination;
- this.denomination = denomination;
- }
-
-
-
-}
\ No newline at end of file
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Transaction.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Transaction.java
deleted file mode 100644
index d5e58f91..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/model/Transaction.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.model;
-
-import java.math.BigDecimal;
-import java.util.logging.Logger;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-/**
- * @author Ram
- *
- */
-
-@Entity
-@Table(name = "transaction")
-public class Transaction {
-
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long transactionId;
- @ManyToOne(targetEntity = Customer.class)
- private Customer customer;
- @ManyToOne(targetEntity = Account.class)
- private Account account;
- private BigDecimal amount;
- private String transactionType;
-
-
- private static final Logger LOGGER = Logger.getLogger( Bank.class.getName() );
-
-
- /**
- *
- */
- public Transaction() {
- super();
- }
-
- /**
- * @param transactionId
- * @param customer
- * @param account
- * @param amount
- * @param transactionType
- */
- public Transaction(Customer customer, Account account, BigDecimal amount, String transactionType) {
- this.customer = customer;
- this.account = account;
- this.amount = amount;
- this.transactionType = transactionType;
- LOGGER.info("Inside the Transaction Entity");
-
- }
-
- /**
- * @return the transactionId
- */
- public Long getTransactionId() {
- return transactionId;
- }
-
- /**
- * @param transactionId
- * the transactionId to set
- */
- public void setTransactionId(Long transactionId) {
- this.transactionId = transactionId;
- }
-
- /**
- * @return the customer
- */
- public Customer getCustomer() {
- return customer;
- }
-
- /**
- * @param customer
- * the customer to set
- */
- public void setCustomer(Customer customer) {
- this.customer = customer;
- }
-
- /**
- * @return the account
- */
- public Account getAccount() {
- return account;
- }
-
- /**
- * @param account
- * the account to set
- */
- public void setAccount(Account account) {
- this.account = account;
- }
-
- /**
- * @return the amount
- */
- public BigDecimal getAmount() {
- return amount;
- }
-
- /**
- * @param amount
- * the amount to set
- */
- public void setAmount(BigDecimal amount) {
- this.amount = amount;
- }
-
- /**
- * @return the transactionType
- */
- public String getTransactionType() {
- return transactionType;
- }
-
- /**
- * @param transactionType
- * the transactionType to set
- */
- public void setTransactionType(String transactionType) {
- this.transactionType = transactionType;
- }
-
- /*
- * @return toString() representation of given object
- */
- @Override
- public String toString() {
- return "Transaction [transactionId=" + transactionId + ", customer=" + customer + ", account=" + account
- + ", amount=" + amount + ", transactionType=" + transactionType + "]";
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/ATMDAO.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/ATMDAO.java
deleted file mode 100644
index 276159f6..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/ATMDAO.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import com.springboot.bank.model.ATM;
-
-/**
- * @author Ram
- *
- */
-public interface ATMDAO extends JpaRepository {
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/AccountDAO.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/AccountDAO.java
deleted file mode 100644
index 91fe7420..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/AccountDAO.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import com.springboot.bank.model.Account;
-
-/**
- * @author Ram
- *
- */
-public interface AccountDAO extends JpaRepository{
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/BankDAO.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/BankDAO.java
deleted file mode 100644
index dd78d4ad..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/BankDAO.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import com.springboot.bank.model.Bank;
-
-/**
- * @author Ram
- *
- */
-public interface BankDAO extends JpaRepository {
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/BankDenominationDAO.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/BankDenominationDAO.java
deleted file mode 100644
index 7def6b06..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/BankDenominationDAO.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import com.springboot.bank.model.Denomination;
-
-/**
- * @author Ram
- *
- */
-
-public interface BankDenominationDAO extends JpaRepository {
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/CustomerDAO.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/CustomerDAO.java
deleted file mode 100644
index 922c7e65..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/CustomerDAO.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import com.springboot.bank.model.Customer;
-
-/**
- * @author Ram
- *
- */
-public interface CustomerDAO extends JpaRepository {
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/TransactionDAO.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/TransactionDAO.java
deleted file mode 100644
index ec26c593..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/repository/TransactionDAO.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.repository;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import com.springboot.bank.model.Transaction;
-
-/**
- * @author Ram
- *
- */
-public interface TransactionDAO extends JpaRepository {
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/ATMService.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/ATMService.java
deleted file mode 100644
index 3599a69b..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/ATMService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import java.math.BigDecimal;
-
-import com.springboot.bank.dto.ATMDetails;
-import com.springboot.bank.dto.WrapperBankATM;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.ATM;
-
-/**
- * @author Ram
- *
- */
-public interface ATMService {
-
- ATM createATM(WrapperBankATM wrapperBankATM) throws BankException;
-
- ATM addMoneyFromBank(Long atmId, Long bankId, BigDecimal moneyToBeAddedToATM) throws BankException;
-
- ATM withdrawMoney(ATMDetails atmDetails) throws BankException;
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/ATMServiceImpl.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/ATMServiceImpl.java
deleted file mode 100644
index e496d258..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/ATMServiceImpl.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import java.math.BigDecimal;
-import java.util.Optional;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.springboot.bank.dto.ATMDetails;
-import com.springboot.bank.dto.WrapperBankATM;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.ATM;
-import com.springboot.bank.model.Account;
-import com.springboot.bank.model.Bank;
-import com.springboot.bank.repository.ATMDAO;
-import com.springboot.bank.repository.AccountDAO;
-import com.springboot.bank.repository.BankDAO;
-
-/**
- * @author Ram
- *
- */
-@Service("ATMService")
-public class ATMServiceImpl implements ATMService {
-
- @Autowired
- ATMDAO atmDao;
-
- @Autowired
- BankDAO bankDao;
-
- @Autowired
- AccountDAO accountDao;
-
- /*
- * @see
- * com.springboot.bank.service.ATMService#createATM(com.springboot.bank.model.
- * ATM)
- */
- @Override
- public ATM createATM(WrapperBankATM wrapperBankATM) throws BankException {
- ATM ATMData = wrapperBankATM.getAtm();
- Long bankId = wrapperBankATM.getBankId();
- Optional bankList = bankDao.findById(bankId);
- Bank bank = bankList.get();
- if (bank == null)
- throw new BankException("Id not found");
- else {
- ATMData.setBank(bank);
- ATMData = atmDao.save(ATMData);
- }
- return ATMData;
- }
-
- @Override
- public ATM addMoneyFromBank(Long atmId, Long bankId, BigDecimal moneyToBeAddedToATM) throws BankException {
-
- Optional atmList = atmDao.findById(atmId);
- ATM atmdata = null;
- ATM atm = atmList.get();
- if (atm == null)
- throw new BankException("Atm with such Id doesnt exist");
- else {
- Optional bankList = bankDao.findById(bankId);
- Bank bank = bankList.get();
- if (bank == null)
- throw new BankException("Bank with such Id doesnt exist");
- else {
- BigDecimal bankMoney = bank.getAmount();
- BigDecimal finalAmount = bankMoney.subtract(moneyToBeAddedToATM);
- if (finalAmount.compareTo(BigDecimal.ZERO) == 1) {
- BigDecimal atmMoney = atm.getMoney().add(moneyToBeAddedToATM);
- atm.setMoney(atmMoney);
- bank.setAmount(finalAmount);
- atmdata = atmDao.save(atm);
- bankDao.save(bank);
- } else
- throw new BankException("Bank doesnt have enough money");
- }
- return atmdata;
- }
- }
-
- @Override
- public ATM withdrawMoney(ATMDetails atmDetails) throws BankException {
- Long atmId = atmDetails.getAccountId();
- Long bankId = atmDetails.getBankId();
- Long accountId = atmDetails.getAccountId();
- BigDecimal amountToBeWithdrawn = atmDetails.getAmount();
- Account account = null;
- Bank bank = null;
- ATM atm = null;
- if (accountId == 0 || bankId == 0 || atmId == 0) {
- throw new BankException("Id cannot be zero");
- }
- else {
- Optional accountList = accountDao.findById(accountId);
- account = accountList.get();
- BigDecimal newAccountBalance;
- if (account == null) {
- throw new BankException("No such account exists");
- } else {
- newAccountBalance = amountToBeWithdrawn.subtract(account.getAmount());
- if (newAccountBalance.compareTo(BigDecimal.ZERO) == 1) {
- account.setAmount(newAccountBalance);
- accountDao.save(account);
- } else {
- throw new BankException("Account Balance cannot be negative");
- }
- }
- Optional bankList = bankDao.findById(bankId);
- bank = bankList.get();
- if (bank == null) {
- throw new BankException("No such id of Bank exists");
- } else {
- BigDecimal newBankBalance = amountToBeWithdrawn.subtract(bank.getAmount());
- if (newBankBalance.compareTo(BigDecimal.ZERO) == 1) {
- bank.setAmount(newBankBalance);
- bankDao.save(bank);
- } else {
- throw new BankException("Bank Balance cannot be negative");
- }
- }
- Optional atmList = atmDao.findById(atmId);
- atm = atmList.get();
- if (atm == null) {
- throw new BankException("No such id of ATM exists");
- } else {
- BigDecimal newBankBalance = amountToBeWithdrawn.subtract(bank.getAmount());
- if (newBankBalance.compareTo(BigDecimal.ZERO) == 1) {
- atm.setMoney(newAccountBalance);
- atmDao.save(atm);
- } else {
- throw new BankException("ATM Balance cannot be negative");
- }
- }
- }
- return atm;
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/AccountService.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/AccountService.java
deleted file mode 100644
index dba2067e..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/AccountService.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import com.springboot.bank.dto.AccountDetails;
-import com.springboot.bank.dto.WrapperBankCustomerAccount;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Account;
-
-/**
- * @author Ram
- *
- */
-public interface AccountService {
-
- Account createAccount(WrapperBankCustomerAccount wrapperBankCustomerAccount) throws BankException;
-
- Account depositMoney(AccountDetails accountDetails) throws BankException;
-
- Account withdrawMoney(AccountDetails accountDetails) throws BankException;
-
- Account getAccountDetails(Long accountId) throws BankException;
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/AccountServiceImpl.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/AccountServiceImpl.java
deleted file mode 100644
index 8819a7fc..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/AccountServiceImpl.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import java.math.BigDecimal;
-import java.util.Optional;
-
-import javax.transaction.Transactional;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.springboot.bank.dto.AccountDetails;
-import com.springboot.bank.dto.WrapperBankCustomerAccount;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Account;
-import com.springboot.bank.model.Bank;
-import com.springboot.bank.model.Customer;
-import com.springboot.bank.model.Transaction;
-import com.springboot.bank.repository.AccountDAO;
-import com.springboot.bank.repository.BankDAO;
-import com.springboot.bank.repository.CustomerDAO;
-
-/**
- * @author Ram
- *
- */
-@Service("accountService")
-public class AccountServiceImpl implements AccountService {
-
- @Autowired
- BankDAO bankDao;
-
- @Autowired
- CustomerDAO customerDao;
-
- @Autowired
- AccountDAO accountDao;
-
- @Autowired
- TransactionService transactionService;
-
- /*
- * @see
- * com.springboot.bank.service.AccountService#createAccount(com.springboot.bank.
- * wrapper.WrapperBankCustomerAccount)
- */
- @Override
- public Account createAccount(WrapperBankCustomerAccount wrapperBankCustomerAccount) throws BankException {
-
- Account account = wrapperBankCustomerAccount.getAccount();
- if (account == null)
- throw new BankException("Account not found");
- else {
- Long bankId = wrapperBankCustomerAccount.getBankId();
- // System.out.println(bankId);
- Optional bankList = bankDao.findById(bankId);
- Bank bank = bankList.get();
- // System.out.println(bank);
- if (bank == null) {
- throw new BankException("Bank with such Id doesnt exist");
- } else {
- account.setBank(bank);
- }
- Long customerId = wrapperBankCustomerAccount.getCustomerId();
- Optional customerList = customerDao.findById(customerId);
- Customer customer = customerList.get();
- if (customer == null) {
- throw new BankException("Customer with such Id doesnt exist");
- } else {
- account.setCustomer(customer);
- account = accountDao.save(account);
- }
- }
- return account;
- }
-
- @Transactional
- @Override
- public Account depositMoney(AccountDetails accountDetails) throws BankException {
-
- Long accountId = accountDetails.getAccountId();
- Long bankId = accountDetails.getBankId();
- Long customerId = accountDetails.getCustomerId();
- BigDecimal amountToBeAdded = accountDetails.getAmount();
- Account account = null;
- Bank bank = null;
- Customer customer = null;
- if (accountId == 0 || bankId == 0 || customerId == 0 || amountToBeAdded.compareTo(BigDecimal.ZERO) == 0)
- throw new BankException("Id or amount cannot be zero");
- else {
- Optional accountList = accountDao.findById(accountId);
- account = accountList.get();
- BigDecimal newAccountBalance;
- if (account == null) {
- throw new BankException("No such account id exists");
- } else {
- newAccountBalance = amountToBeAdded.add(account.getAmount());
- Optional customerList = customerDao.findById(customerId);
- customer = customerList.get();
- if (customer == null) {
- throw new BankException("No such customer account exists");
- } else {
- Optional bankList = bankDao.findById(bankId);
- bank = bankList.get();
- if (bank == null) {
- throw new BankException("No such bank account exists");
- } else {
- account.setAmount(newAccountBalance);
- accountDao.save(account);
- Transaction transaction = new Transaction(customer, account, amountToBeAdded,
- "Money Deposited");
- transactionService.createTransaction(transaction);
- BigDecimal newBankBalance = amountToBeAdded.add(bank.getAmount());
- bank.setAmount(newBankBalance);
- bankDao.save(bank);
- }
- }
- }
- }
- return account;
- }
-
- @Transactional
- @Override
- public Account withdrawMoney(AccountDetails accountDetails) throws BankException {
- Long accountId = accountDetails.getAccountId();
- Long bankId = accountDetails.getBankId();
- Long customerId = accountDetails.getCustomerId();
- BigDecimal amountToBeWithdrawn = accountDetails.getAmount();
- Account account = null;
- Bank bank = null;
- Customer customer = null;
- if (accountId == 0 || bankId == 0 || customerId == 0) {
- throw new BankException("Id or amount cannot be zero");
- }else {
- Optional accountList = accountDao.findById(accountId);
- account = accountList.get();
- BigDecimal newAccountBalance;
- if (account == null) {
- throw new BankException("No such account exists");
- } else {
- newAccountBalance = account.getAmount().subtract(amountToBeWithdrawn);
- if (newAccountBalance.compareTo(BigDecimal.ZERO) == -1) {
- throw new BankException("Account Balance cannot be 0 or negative");
- } else {
- Optional bankList = bankDao.findById(bankId);
- bank = bankList.get();
- if (bank == null) {
- throw new BankException("No such bank id exists");
- } else {
- BigDecimal newBankBalance = bank.getAmount().subtract(amountToBeWithdrawn);
- if (newBankBalance.compareTo(BigDecimal.ZERO) == 0
- || newBankBalance.compareTo(BigDecimal.ZERO) == -1) {
- throw new BankException("Bank Balance cannot be 0 or negative");
- } else {
- Optional customerList = customerDao.findById(customerId);
- customer = customerList.get();
- if (customer == null) {
- throw new BankException("No such customer id exists");
- } else {
- Transaction transaction = new Transaction(customer, account, amountToBeWithdrawn,
- "Money Withdrawn");
- transactionService.createTransaction(transaction);
- account.setAmount(newAccountBalance);
- accountDao.save(account);
- bank.setAmount(newBankBalance);
- bankDao.save(bank);
-
- }
- }
- }
- }
- }
- }
- return account;
- }
-
- @Override
- public Account getAccountDetails(Long accountId) throws BankException {
- Optional accountList = accountDao.findById(accountId);
- Account account = null;
- account = accountList.get();
- if (account == null)
- throw new BankException("Account id doesnt exist");
- else {
- account = accountDao.save(account);
- }
- return account;
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankDenominationService.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankDenominationService.java
deleted file mode 100644
index 761aed66..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankDenominationService.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import com.springboot.bank.dto.WrapperDenomination;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Denomination;
-
-/**
- * @author Ram
- *
- */
-public interface BankDenominationService {
-
-
-
- void addDenominationNew(Integer amount) throws BankException;
-
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankDenominationServiceImpl.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankDenominationServiceImpl.java
deleted file mode 100644
index 5387ca94..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankDenominationServiceImpl.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import java.util.Random;
-import java.util.logging.Logger;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.springboot.bank.dto.WrapperDenomination;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Account;
-import com.springboot.bank.model.Bank;
-import com.springboot.bank.model.Denomination;
-import com.springboot.bank.model.Denomination;
-import com.springboot.bank.repository.BankDAO;
-import com.springboot.bank.repository.BankDenominationDAO;
-
-/**
- * @author Ram
- *
- */
-@Service("bankDenominationService")
-public class BankDenominationServiceImpl implements BankDenominationService {
-
-
-
- private static final Logger LOGGER = Logger.getLogger( Account.class.getName() );
-
-
-
- @Autowired
- private BankDenominationDAO bankDenominationDAO;
-
-
- @Autowired
- BankDAO bankDao;
-
- /*
- * @Override public BankDenomination addDenomination(WrapperBankDenomination
- * wrapperBankDenomination) throws BankException { Long bankId =
- * wrapperBankDenomination.getBankId(); Integer amount =
- * wrapperBankDenomination.getAmount(); BankDenomination bankDenomination =
- * wrapperBankDenomination.getBankDenomination(); Bank bank = null; Integer
- * noOf2000s = null; Integer noOf500s = null; Integer noOf100s = null; Integer
- * temperoryCount = 0; if (amount / 2000 != 0) { noOf2000s = amount / 2000;
- * amount = amount % 2000; System.out.println(noOf2000s); temperoryCount =
- * temperoryCount + noOf2000s; bankDenomination.setNoOf2000s(noOf2000s); } if
- * (amount != 0 & amount / 500 != 0) { noOf500s = amount / 500; amount = amount
- * % 500; temperoryCount = temperoryCount + noOf500s;
- * bankDenomination.setNoOf500s(noOf500s); }
- *
- * if (amount != 0 & amount / 100 != 0) { noOf100s = amount / 100; amount =
- * amount % 100; temperoryCount = temperoryCount + noOf100s;
- * bankDenomination.setNoOf100s(noOf100s); }
- *
- * Optional bankList = bankDao.findById(bankId); if (bankList.isPresent())
- * { bank = bankList.get(); bankDenomination.setBank(bank);
- * bankDenomination.setNoOfDenomination(temperoryCount);
- * bankDenominationDAO.save(bankDenomination); } else { throw new
- * BankException("bank is not present"); } return bankDenomination; }
- */
-
- @Override
- public void addDenominationNew(final Integer amount) throws BankException {
-
- final List list1 = new ArrayList();
- list1.add(2000);
- list1.add(500);
- list1.add(100);
- list1.add(200);
- final Random rand = new Random();
- Integer remainder = amount;
- //System.out.println("list >>>>" + list1);
- LOGGER.info("list >>>>" + list1);
- for (int i = 0; i <= list1.size(); i++) {
- final Integer randomIndex = rand.nextInt(list1.size());
- // System.out.println("randomIndex >>" + randomIndex);
- final Integer randomElement = list1.get(randomIndex);
- // System.out.println("randomElement >>" + randomElement);
- if (randomElement.compareTo(remainder) == 0 || randomElement.compareTo(remainder) == -1) {
- final Denomination bankDenominationNew = new Denomination();
- bankDenominationNew.setNoOfDenomination(remainder / randomElement);
- bankDenominationNew.setDenomination(randomElement);
- remainder = remainder % randomElement;
- //System.out.println(bankDenominationNew);
- LOGGER.info(">>>> Denomination"+bankDenominationNew);
- if (remainder == 0) {
- break;
- }
- }
- list1.remove(randomIndex);
- }
-
- }
-}
\ No newline at end of file
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankService.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankService.java
deleted file mode 100644
index ef543af1..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankService.java
+++ /dev/null
@@ -1,22 +0,0 @@
-
-/**
- *
- */
-package com.springboot.bank.service;
-
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Bank;
-
-/**
- * @author Ram
- * @nterface BankService
- * Description : It has 2 methods declaration in it. whichever class will implements,
- * will provide implemenatation for this methods.
- *
- */
-public interface BankService {
-
- Bank createBank(Bank bank) throws BankException;
-
- Bank getBankDetails(Long bankId) throws BankException;
-}
\ No newline at end of file
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankServiceImpl.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankServiceImpl.java
deleted file mode 100644
index 9fafbc48..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/BankServiceImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import java.math.BigDecimal;
-import java.util.Optional;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Bank;
-import com.springboot.bank.repository.BankDAO;
-
-/**
- * @author Ram
- * @Service("bankService")
- * Description : It provide implementation for BankServices method.
- * 1.It Helps to create new bank
- * 2.getBankDetails
- */
-@Service("bankService")
-public class BankServiceImpl implements BankService {
-
-
- //Injecting properties of BankDAO
- @Autowired
- private BankDAO bankDao;
-
- /*
- * BankService#createBank
- * Desc: this method helps to create a new bank with default amount 0.
- *
- */
- @Override
- public Bank createBank(Bank bank) throws BankException {
- Bank bankData = null;
- final BigDecimal amount = bank.getAmount();
- /*if (amount.compareTo(BigDecimal.ZERO) == -1)
- throw new BankException("amount cannot be zero or less than zero");
- else {*/
- bankData = bankDao.save(bank);
- return bankData;
- }
-
- /*
- *BankService#getBankDetails
- *Desc : It will helps to get information about details of bank passing a Id of it.
- *Exception : it will throw exception if Id not found.
- */
- @Override
- public Bank getBankDetails(Long bankId) throws BankException {
- Optional bankList = bankDao.findById(bankId);
- if (bankList.isPresent()) {
- Bank bank = bankList.get();
- return bank;
- } else
- throw new BankException("Bank details not found");
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/CustomerService.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/CustomerService.java
deleted file mode 100644
index a857db87..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/CustomerService.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import com.springboot.bank.dto.WrapperBankCustomer;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Customer;
-
-/**
- * @author Ram
- *@entity CustomerService
- *Desc: It has 2 methods declared which helps to create customer and get customer details.
- */
-public interface CustomerService {
-
- Customer createCustomer(WrapperBankCustomer wrapperBankCustomer) throws BankException;
-
- Customer getCustomerDetails(Long customerId) throws BankException;
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/CustomerServiceImpl.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/CustomerServiceImpl.java
deleted file mode 100644
index dfc9283e..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/CustomerServiceImpl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import java.util.Optional;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.springboot.bank.dto.WrapperBankCustomer;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Bank;
-import com.springboot.bank.model.Customer;
-import com.springboot.bank.repository.BankDAO;
-import com.springboot.bank.repository.CustomerDAO;
-
-/**
- * @author Ram
- *@Service("customerService")
- *Desc: This class provide implementation for creating customer and
- */
-@Service("customerService")
-public class CustomerServiceImpl implements CustomerService {
-
-
-
- //injecting properties of CustomerDAO
- @Autowired
- CustomerDAO customerDao;
- //injecting properties of BankDAO
- @Autowired
- BankDAO bankDao;
-
- /*
- * CustomerService#createCustomer
- * DESC: it will create a new customer having bankId associated with it.
- * It calls save method to save he state of customer object into database.
- */
-
-
- @Override
- public Customer createCustomer(WrapperBankCustomer wrapperBankCustomer) throws BankException {
- Customer customer = null;
- Customer customerData = null;
- customer = wrapperBankCustomer.getCustomer();
- // System.out.println(customer);
- Long bankId = wrapperBankCustomer.getBankId();
- Optional bankList = bankDao.findById(bankId);
- Bank bank = bankList.get();
- customer.setBank(bank);
- customerData = customerDao.save(customer);
- // System.out.println(customerData);
- return customerData;
- }
- /*
- * CustomerService#createCustomer
- * DESC: it will show customer details having customerId associated with it.
- * It calls findById method to find that entity by id and return the object to responce.
- */
- @Override
- public Customer getCustomerDetails(Long customerId) throws BankException {
- Optional customerList = customerDao.findById(customerId);
- if (customerList.isPresent()) {
- Customer customer = customerList.get();
- return customer;
- } else
- throw new BankException("Bank details not found");
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/TransactionService.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/TransactionService.java
deleted file mode 100644
index 0d4cdb20..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/TransactionService.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import java.util.Optional;
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Transaction;
-
-/**
- * @author Ram
- *this interface has 2 methods which create a statements for an Customer
- *and generate a report for statements
- */
-public interface TransactionService {
-
- String createTransaction(Transaction transaction) throws BankException;
-
- Optional getTransactionDetails( Long customerId) throws BankException;
-}
diff --git a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/TransactionServiceImpl.java b/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/TransactionServiceImpl.java
deleted file mode 100644
index 5575548d..00000000
--- a/16BankAppSpringBootJPA/src/main/java/com/springboot/bank/service/TransactionServiceImpl.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- *
- */
-package com.springboot.bank.service;
-
-import java.util.Optional;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.springboot.bank.exception.BankException;
-import com.springboot.bank.model.Account;
-import com.springboot.bank.model.Customer;
-import com.springboot.bank.model.Transaction;
-import com.springboot.bank.repository.CustomerDAO;
-import com.springboot.bank.repository.TransactionDAO;
-
-/**
- * @author Ram
- *
- */
-@Service("transactionService")
-public class TransactionServiceImpl implements TransactionService {
-
- //Injecting properties of TransactionDAO
- @Autowired
- private TransactionDAO transactionDao;
- //Injecting properties of CustomerDAO
- @Autowired
- private CustomerDAO customerdao;
-
- /*
- *
- *TransactionService#createTransaction
- * DESC: it will create a statement for a account of a customer
- * which contain typeOfPayment,AMount etc.
- * Exception: It throws exception if user enter acoount id or customr ID 0.
- */
- @Override
- public String createTransaction(Transaction transaction) throws BankException {
-
- Customer customer = transaction.getCustomer();
- Long customerId = customer.getCustomerId();
- Account account = transaction.getAccount();
- Long accountId = account.getAccountId();
-
- if (accountId == 0) {
- throw new BankException("accountId cannot be 0");
- } else if (customerId == 0) {
- throw new BankException("customerId cannot be 0");
- } else {
- transactionDao.save(transaction);
- return "Transaction details added successfully";
- }
- }
-
-
- /*
- *
- *TransactionService#getTransactionDetails
- * DESC: it will get details statement for a account of a customer
- * which contain typeOfPayment,AMount etc.
- */
-
- @Override
- public Optional getTransactionDetails(Long customerId) throws BankException {
-
- if (customerId == 0) {
- throw new BankException("customerId cannot be 0");
- } else {
- Optional transactionList = transactionDao.findById(customerId);
- return transactionList;
- }
- }
-}
diff --git a/16BankAppSpringBootJPA/src/main/resources/application.properties b/16BankAppSpringBootJPA/src/main/resources/application.properties
deleted file mode 100644
index 91dd5aff..00000000
--- a/16BankAppSpringBootJPA/src/main/resources/application.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-spring.datasource.url= jdbc:mysql://localhost:3306/mybank
-spring.datasource.username=root
-spring.datasource.password=root
-spring.jpa.show-sql=true
-spring.jpa.hibernate.ddl-auto=update
-logging.level.root=info
-
diff --git a/16BankAppSpringBootJPA/src/test/java/com/springboot/bank/BankApplicationTests.java b/16BankAppSpringBootJPA/src/test/java/com/springboot/bank/BankApplicationTests.java
deleted file mode 100644
index 3bccdd00..00000000
--- a/16BankAppSpringBootJPA/src/test/java/com/springboot/bank/BankApplicationTests.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.springboot.bank;
-
-import static org.mockito.Mockito.mock;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-import com.springboot.bank.service.AccountService;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class BankApplicationTests {
-
- AccountService accountServiceMock = mock(AccountService.class);
-
-
-}
diff --git a/16BankAppSpringBootJPA/src/test/java/com/springboot/bank/CustomerServiceTest.java b/16BankAppSpringBootJPA/src/test/java/com/springboot/bank/CustomerServiceTest.java
deleted file mode 100644
index 14b83d8d..00000000
--- a/16BankAppSpringBootJPA/src/test/java/com/springboot/bank/CustomerServiceTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- *
- */
-package com.springboot.bank;
-
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-import com.springboot.bank.dto.WrapperBankCustomer;
-import com.springboot.bank.model.Customer;
-import com.springboot.bank.repository.CustomerDAO;
-import com.springboot.bank.service.CustomerService;
-
-/**
- * @author ram
- *
- */
-public class CustomerServiceTest {
-
- @Mock
- private CustomerDAO daoMock;
-
- @InjectMocks
- private CustomerService service;
-
- @Before
- public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
- }
-
- @Test
- public void testAddCustomer_returnsNewCustomer() {
-
-
- }
-
-}
diff --git a/16BankAppSpringBootJPA/target/classes/META-INF/MANIFEST.MF b/16BankAppSpringBootJPA/target/classes/META-INF/MANIFEST.MF
deleted file mode 100644
index d7c94a95..00000000
--- a/16BankAppSpringBootJPA/target/classes/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,10 +0,0 @@
-Manifest-Version: 1.0
-Implementation-Title: MyBankDemo
-Implementation-Version: 0.0.1-SNAPSHOT
-Built-By: trainee
-Implementation-Vendor-Id: com.springboot
-Build-Jdk: 1.8.0_171
-Implementation-URL: https://projects.spring.io/spring-boot/#/spring-bo
- ot-starter-parent/bank
-Created-By: Maven Integration for Eclipse
-
diff --git a/16BankAppSpringBootJPA/target/classes/META-INF/maven/com.springboot/bank/pom.properties b/16BankAppSpringBootJPA/target/classes/META-INF/maven/com.springboot/bank/pom.properties
deleted file mode 100644
index 153572fd..00000000
--- a/16BankAppSpringBootJPA/target/classes/META-INF/maven/com.springboot/bank/pom.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-#Generated by Maven Integration for Eclipse
-#Tue May 22 10:18:26 IST 2018
-version=0.0.1-SNAPSHOT
-groupId=com.springboot
-m2e.projectName=bank
-m2e.projectLocation=D\:\\training\\16BankAppSpringBootJPA
-artifactId=bank
diff --git a/16BankAppSpringBootJPA/target/classes/META-INF/maven/com.springboot/bank/pom.xml b/16BankAppSpringBootJPA/target/classes/META-INF/maven/com.springboot/bank/pom.xml
deleted file mode 100644
index d09d388b..00000000
--- a/16BankAppSpringBootJPA/target/classes/META-INF/maven/com.springboot/bank/pom.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
- 4.0.0
-
- com.springboot
- bank
- 0.0.1-SNAPSHOT
- jar
-
- MyBankDemo
- project for Bank Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.2.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- mysql
- mysql-connector-java
-
-
-
- log4j
- log4j
- 1.2.17
-
-
-
- org.mockito
- mockito-all
- 1.9.5
- test
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
diff --git a/16BankAppSpringBootJPA/target/classes/application.properties b/16BankAppSpringBootJPA/target/classes/application.properties
deleted file mode 100644
index 91dd5aff..00000000
--- a/16BankAppSpringBootJPA/target/classes/application.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-spring.datasource.url= jdbc:mysql://localhost:3306/mybank
-spring.datasource.username=root
-spring.datasource.password=root
-spring.jpa.show-sql=true
-spring.jpa.hibernate.ddl-auto=update
-logging.level.root=info
-
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/BankApplication.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/BankApplication.class
deleted file mode 100644
index ab7e0187..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/BankApplication.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/ATMController.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/ATMController.class
deleted file mode 100644
index 1eaa0cfe..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/ATMController.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/AccountController.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/AccountController.class
deleted file mode 100644
index 3d0938c4..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/AccountController.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/BankController.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/BankController.class
deleted file mode 100644
index 9594887b..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/BankController.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/BankDenominationController.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/BankDenominationController.class
deleted file mode 100644
index 406a14d9..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/BankDenominationController.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/CustomerController.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/CustomerController.class
deleted file mode 100644
index 6f437e5c..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/CustomerController.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/TransactionController.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/TransactionController.class
deleted file mode 100644
index fc5f5c88..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/controller/TransactionController.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/ATMDetails.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/ATMDetails.class
deleted file mode 100644
index a4b60d61..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/ATMDetails.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/AccountDetails.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/AccountDetails.class
deleted file mode 100644
index 0126af32..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/AccountDetails.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperATMDenomination.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperATMDenomination.class
deleted file mode 100644
index d166ddb0..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperATMDenomination.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperAccountDenomination.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperAccountDenomination.class
deleted file mode 100644
index b764f297..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperAccountDenomination.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankATM.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankATM.class
deleted file mode 100644
index 17d497fd..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankATM.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankCustomer.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankCustomer.class
deleted file mode 100644
index d5e2f9ad..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankCustomer.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankCustomerAccount.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankCustomerAccount.class
deleted file mode 100644
index 30646c54..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankCustomerAccount.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankDenomination.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankDenomination.class
deleted file mode 100644
index dcabeb15..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperBankDenomination.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperDenomination.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperDenomination.class
deleted file mode 100644
index 16292fae..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/dto/WrapperDenomination.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/exception/BankException.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/exception/BankException.class
deleted file mode 100644
index bc0fb220..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/exception/BankException.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/ATM.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/ATM.class
deleted file mode 100644
index 4d15c9d3..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/ATM.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Account.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Account.class
deleted file mode 100644
index 07c168c0..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Account.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Bank.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Bank.class
deleted file mode 100644
index 398e6d87..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Bank.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/BankDenomination.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/BankDenomination.class
deleted file mode 100644
index f1a46277..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/BankDenomination.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Customer.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Customer.class
deleted file mode 100644
index 5dfefaa9..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Customer.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Denomination.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Denomination.class
deleted file mode 100644
index a3763c60..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Denomination.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Transaction.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Transaction.class
deleted file mode 100644
index fd16e723..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/model/Transaction.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/ATMDAO.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/ATMDAO.class
deleted file mode 100644
index 6326d873..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/ATMDAO.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/AccountDAO.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/AccountDAO.class
deleted file mode 100644
index 1f516ff9..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/AccountDAO.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/BankDAO.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/BankDAO.class
deleted file mode 100644
index de6da26a..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/BankDAO.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/BankDenominationDAO.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/BankDenominationDAO.class
deleted file mode 100644
index 6d542662..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/BankDenominationDAO.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/CustomerDAO.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/CustomerDAO.class
deleted file mode 100644
index 9d4b7691..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/CustomerDAO.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/TransactionDAO.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/TransactionDAO.class
deleted file mode 100644
index 0162a54e..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/repository/TransactionDAO.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/ATMService.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/ATMService.class
deleted file mode 100644
index b87803fe..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/ATMService.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/ATMServiceImpl.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/ATMServiceImpl.class
deleted file mode 100644
index 8033e254..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/ATMServiceImpl.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/AccountService.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/AccountService.class
deleted file mode 100644
index 9a9f3041..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/AccountService.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/AccountServiceImpl.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/AccountServiceImpl.class
deleted file mode 100644
index 1a4ce626..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/AccountServiceImpl.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankDenominationService.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankDenominationService.class
deleted file mode 100644
index 3342e6f1..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankDenominationService.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankDenominationServiceImpl.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankDenominationServiceImpl.class
deleted file mode 100644
index c612e424..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankDenominationServiceImpl.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankService.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankService.class
deleted file mode 100644
index 90716f05..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankService.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankServiceImpl.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankServiceImpl.class
deleted file mode 100644
index 723b10ed..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/BankServiceImpl.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/CustomerService.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/CustomerService.class
deleted file mode 100644
index a5be7366..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/CustomerService.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/CustomerServiceImpl.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/CustomerServiceImpl.class
deleted file mode 100644
index 396693fb..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/CustomerServiceImpl.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/TransactionService.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/TransactionService.class
deleted file mode 100644
index 51667e7e..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/TransactionService.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/TransactionServiceImpl.class b/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/TransactionServiceImpl.class
deleted file mode 100644
index f62346d2..00000000
Binary files a/16BankAppSpringBootJPA/target/classes/com/springboot/bank/service/TransactionServiceImpl.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/test-classes/com/springboot/bank/BankApplicationTests.class b/16BankAppSpringBootJPA/target/test-classes/com/springboot/bank/BankApplicationTests.class
deleted file mode 100644
index faca8cfd..00000000
Binary files a/16BankAppSpringBootJPA/target/test-classes/com/springboot/bank/BankApplicationTests.class and /dev/null differ
diff --git a/16BankAppSpringBootJPA/target/test-classes/com/springboot/bank/CustomerServiceTest.class b/16BankAppSpringBootJPA/target/test-classes/com/springboot/bank/CustomerServiceTest.class
deleted file mode 100644
index 83775688..00000000
Binary files a/16BankAppSpringBootJPA/target/test-classes/com/springboot/bank/CustomerServiceTest.class and /dev/null differ
diff --git a/17BankInCapg/.eclipse-pmd b/17BankInCapg/.eclipse-pmd
deleted file mode 100644
index 3b4f2d8a..00000000
--- a/17BankInCapg/.eclipse-pmd
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/17BankInCapg/.gitignore b/17BankInCapg/.gitignore
deleted file mode 100644
index 82eca336..00000000
--- a/17BankInCapg/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/build/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
\ No newline at end of file
diff --git a/17BankInCapg/.mvn/wrapper/maven-wrapper.jar b/17BankInCapg/.mvn/wrapper/maven-wrapper.jar
deleted file mode 100644
index 9cc84ea9..00000000
Binary files a/17BankInCapg/.mvn/wrapper/maven-wrapper.jar and /dev/null differ
diff --git a/17BankInCapg/.mvn/wrapper/maven-wrapper.properties b/17BankInCapg/.mvn/wrapper/maven-wrapper.properties
deleted file mode 100644
index b573bb50..00000000
--- a/17BankInCapg/.mvn/wrapper/maven-wrapper.properties
+++ /dev/null
@@ -1 +0,0 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
diff --git a/17BankInCapg/mvnw b/17BankInCapg/mvnw
deleted file mode 100644
index 5bf251c0..00000000
--- a/17BankInCapg/mvnw
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/17BankInCapg/mvnw.cmd b/17BankInCapg/mvnw.cmd
deleted file mode 100644
index 019bd74d..00000000
--- a/17BankInCapg/mvnw.cmd
+++ /dev/null
@@ -1,143 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/17BankInCapg/pom.xml b/17BankInCapg/pom.xml
deleted file mode 100644
index 91fcd516..00000000
--- a/17BankInCapg/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
- 4.0.0
-
- com.bankApplication
- BANKAPPLICATION
- 0.0.1-SNAPSHOT
- jar
-
- transactionInBank
- Demo project for Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.1.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- mysql
- mysql-connector-java
- 5.1.38
- runtime
-
-
- com.h2database
- h2
- test
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
diff --git a/17BankInCapg/src/main/java/com/bank/Exception/ManagedException.java b/17BankInCapg/src/main/java/com/bank/Exception/ManagedException.java
deleted file mode 100644
index f65ebb09..00000000
--- a/17BankInCapg/src/main/java/com/bank/Exception/ManagedException.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.bank.Exception;
-
-public class ManagedException extends Exception {
- public ManagedException(String msg) {
-
-
-
- super(msg);
- }
-
-}
diff --git a/17BankInCapg/src/main/java/com/bank/TransactionInBankApplication.java b/17BankInCapg/src/main/java/com/bank/TransactionInBankApplication.java
deleted file mode 100644
index adfb82f0..00000000
--- a/17BankInCapg/src/main/java/com/bank/TransactionInBankApplication.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.bank;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class TransactionInBankApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(TransactionInBankApplication.class, args);
- }
-}
diff --git a/17BankInCapg/src/main/java/com/bank/controller/ATMController.java b/17BankInCapg/src/main/java/com/bank/controller/ATMController.java
deleted file mode 100644
index 06ec2031..00000000
--- a/17BankInCapg/src/main/java/com/bank/controller/ATMController.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.bank.controller;
-
-import java.util.Optional;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.bank.Exception.ManagedException;
-import com.bank.dto.ATMReq;
-import com.bank.dto.AddMoneyReq;
-import com.bank.dto.WithrawMoneyReq;
-import com.bank.model.ATM;
-import com.bank.model.Bank;
-import com.bank.service.IATMService;
-import com.bank.service.IBankService;
-
-//To call Restful services
-@RestController
-public class ATMController {
-
- // Injecting properties of IATMService to use its methods
- @Autowired
- private IATMService atmService;
- // Injecting properties of IBankService to use its methods in current class
- @Autowired
- private IBankService bankService;
-
- /*
- * description : this method will return a atm instance
- */
- @PostMapping("/atmCreate")
- public ResponseEntity> createATM(@RequestBody final ATMReq atm) {
-
- ATM atm1 = null;
- try {
- final Optional bank = bankService.getBankDetailsByID(atm.getBankId());
- ATM atm2 = atm.getAtm();
- atm2.setBankId(bank.get().getBankId());
- atm1 = atmService.createATM(atm2);
- return new ResponseEntity(atm1, HttpStatus.CREATED);
- } catch (ManagedException e) {
- e.getMessage();
- return new ResponseEntity("Atm not created", HttpStatus.OK);
- }
-
- }
- /*
- * description : this method will return a
- * String message if money successfully added from bank
- */
-
- @PostMapping("/addMoneyInAtm")
- public ResponseEntity> addMoneyToATM(@RequestBody final AddMoneyReq atm) {
-
- try {
- final String str = atmService.addMoneyFromBank(atm);
- return new ResponseEntity(str, HttpStatus.OK);
- } catch (ManagedException e) {
- e.getMessage();
- return new ResponseEntity("money to atm not deposited succesfully!!!", HttpStatus.OK);
- }
-
- }
-
- /*
- * description : this method will return
- * String if amount is successfully withdraw
- */
- @PostMapping("/withdrawAtm")
- public ResponseEntity> withdrawFromAtm(@RequestBody final WithrawMoneyReq atm) {
-
- try {
- final Long id = atmService.withrawMoney(atm);
- return new ResponseEntity(id, HttpStatus.OK);
- } catch (ManagedException e) {
- e.getMessage();
- return new ResponseEntity