Commit d483e084 by Patryk Czarnik

Przeniesienie definicji wyjątków z baza do model

parent 9b21b755
......@@ -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 {
......
......@@ -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 {
......
......@@ -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;
@RequestScoped
......
......@@ -14,9 +14,9 @@ import jakarta.ws.rs.core.Response.Status;
import jakarta.ws.rs.core.UriBuilder;
import sklep.db.CustomerDAO;
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.Customer;
import sklep.model.Order;
......
......@@ -6,9 +6,9 @@ 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;
......
......@@ -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;
import sklep.photo.PhotoUtil;
......
......@@ -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;
import sklep.photo.PhotoUtil;
......
......@@ -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;
import sklep.model.ProductList;
import sklep.photo.PhotoUtil;
......
......@@ -3,7 +3,7 @@ package sklep.rest.ext;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
import sklep.db.RecordNotFound;
import sklep.exn.RecordNotFound;
@Provider
public class RecordNotFoundMapper implements ExceptionMapper<RecordNotFound> {
......
......@@ -4,7 +4,7 @@ import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.Response.Status;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
import sklep.db.SklepException;
import sklep.exn.SklepException;
@Provider
public class SklepExceptionMapper implements ExceptionMapper<SklepException> {
......
......@@ -11,9 +11,9 @@ 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_product")
......
......@@ -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;
public class ProductBean {
......
......@@ -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")
......
......@@ -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;
......
......@@ -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;
......
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