Commit bd977b6d by Patryk Czarnik

Przenieniesienie definicji wyjątków z bazy do modelu

parent a6dab807
......@@ -6,6 +6,8 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Customer;
public class CustomerDAO {
......
......@@ -5,6 +5,8 @@ import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
import sklep.exn.DBException;
public class DBConnection implements AutoCloseable {
private Connection sqlConnection;
......
......@@ -6,6 +6,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import sklep.exn.DBException;
public class DBSettings {
public static final String DB_SETTINGS_SYSTEM_PROPERTY = "sklep.db_settings_location";
private static final String INTERNAL_DEFAULT_PROPERTIES = "/sklep.properties";
......
......@@ -6,6 +6,8 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Order;
import sklep.model.OrderProduct;
......
......@@ -7,6 +7,8 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Product;
/* DAO - Data Access Object(s)
......
......@@ -2,6 +2,7 @@ package sklep.db;
import java.util.List;
import sklep.exn.DBException;
import sklep.model.Product;
public class ZwyklyOdczyt_DAO {
......
......@@ -9,9 +9,9 @@ import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
import sklep.db.DBException;
import sklep.db.DBSettings;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
public class PhotoUtil {
......
......@@ -15,8 +15,8 @@ import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.UriBuilder;
import sklep.db.CustomerDAO;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Customer;
@Path("/customers")
......
......@@ -5,9 +5,9 @@ import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Product;
@Path("/products.html")
......
......@@ -12,9 +12,9 @@ import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.Response.Status;
import jakarta.ws.rs.core.UriBuilder;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.OrderDAO;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Order;
@Path("/orders")
......
......@@ -15,9 +15,9 @@ import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.UriBuilder;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Product;
import sklep.model.ProductList;
......
......@@ -12,9 +12,9 @@ import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Product;
@Path("/products.json")
......
......@@ -5,9 +5,9 @@ import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Product;
import sklep.model.ProductList;
......
......@@ -9,9 +9,9 @@ import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Price;
import sklep.model.Product;
import sklep.model.ProductList;
......
......@@ -12,7 +12,7 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>wielomodulowy-baza</artifactId>
<artifactId>wielomodulowy-model</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
......
......@@ -6,8 +6,8 @@ import java.util.List;
import jakarta.jws.WebParam;
import jakarta.jws.WebResult;
import jakarta.jws.WebService;
import sklep.db.DBException;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Customer;
import sklep.model.Order;
import sklep.model.Product;
......
......@@ -2,7 +2,7 @@ package sklep.klient;
import java.util.List;
import sklep.db.DBException;
import sklep.exn.DBException;
import sklep.model.Product;
import sklep.soap.Sklep;
......
......@@ -2,8 +2,8 @@ package sklep.klient;
import java.util.Scanner;
import sklep.db.DBException;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Product;
import sklep.soap.Sklep;
......
......@@ -4,8 +4,8 @@ import java.math.BigDecimal;
import java.util.Locale;
import java.util.Scanner;
import sklep.db.DBException;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Product;
import sklep.soap.Sklep;
......
......@@ -19,8 +19,8 @@ import javax.swing.SwingWorker;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import sklep.db.DBException;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Product;
import sklep.soap.Sklep;
......
......@@ -9,9 +9,9 @@ import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
import sklep.db.DBException;
import sklep.db.DBSettings;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
public class PhotoUtil {
......
......@@ -7,10 +7,10 @@ import jakarta.jws.WebService;
import jakarta.xml.ws.soap.MTOM;
import sklep.db.CustomerDAO;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.OrderDAO;
import sklep.db.ProductDAO;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Customer;
import sklep.model.Order;
import sklep.model.Product;
......
......@@ -10,9 +10,9 @@ import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
import sklep.model.Product;
@WebServlet("/edit")
......
......@@ -8,7 +8,7 @@ import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import sklep.db.RecordNotFound;
import sklep.exn.RecordNotFound;
@WebServlet("/photo")
public class Photo extends HttpServlet {
......
......@@ -8,9 +8,9 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import sklep.db.DBException;
import sklep.db.DBSettings;
import sklep.db.RecordNotFound;
import sklep.exn.DBException;
import sklep.exn.RecordNotFound;
public class PhotoUtil {
......
......@@ -4,8 +4,8 @@ import java.math.BigDecimal;
import java.util.List;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.exn.DBException;
import sklep.model.Product;
/* Ta klasa jest po to, aby w skrypcie JSP w wygodny sposób odczytać sobie listę produktów z bazy danych. */
......
......@@ -10,8 +10,8 @@ import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.exn.DBException;
import sklep.model.Product;
@WebServlet("/products1")
......
......@@ -10,8 +10,8 @@ import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.exn.DBException;
import sklep.model.Product;
@WebServlet("/products2")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment