интерфейсы взаимодействия с бд

This commit is contained in:
parap 2023-05-22 03:39:22 +04:00
parent 9220c40d24
commit dbabc4561b
5 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,12 @@
package org.dbms.storageContracts;
import org.dbms.models.Car;
import java.util.List;
public interface ICarStorage {
List<Car> readAll();
Car getElementById(Long carId);
void insert(Car car);
void delete(Long carId);
}

View File

@ -0,0 +1,15 @@
package org.dbms.storageContracts;
import org.dbms.models.Car;
import org.dbms.models.Client;
import java.util.List;
public interface IClientStorage {
List<Client> readAll();
Client getElementById(Long clientId);
void insert(Client client);
void delete(Long clientId);
Client getByLogin(String login);
String getIdByLogin(String login);
}

View File

@ -0,0 +1,19 @@
package org.dbms.storageContracts;
import org.dbms.models.Car;
import org.dbms.models.Driver;
import org.dbms.models.Order;
import org.dbms.searchModels.DriverSearch;
import java.util.List;
public interface IDriverStorage {
List<Driver> readAll();
List<Driver> readPage(int size, int page);
int getFilteredCount(DriverSearch filter);
Driver getElementById(Long driverId);
void insert(Driver driver);
void delete(Long driverId);
List<Driver> getFilteredList(DriverSearch filter);
List<Driver> getFilteredPage(DriverSearch filter, int size, int page);
}

View File

@ -0,0 +1,16 @@
package org.dbms.storageContracts;
import org.dbms.models.Car;
import org.dbms.models.Order;
import java.util.List;
public interface IOrderStorage {
List<Order> readAll();
List<Order> readPageByClientId(int size, int page, Long clientId);
int getCountByClientId(Long clientId);
Order getElementById(Long orderId);
List<Order> getOrdersByClientId(Long clientId);
void insert(Order order);
void delete(Long orderId);
}

View File

@ -0,0 +1,13 @@
package org.dbms.storageContracts;
import org.dbms.models.Car;
import org.dbms.models.Parking;
import java.util.List;
public interface IParkingStorage {
List<Parking> readAll();
Parking getElementById(Long parkingId);
void insert(Parking parking);
void delete(Long parkingId);
}