интерфейсы взаимодействия с бд
This commit is contained in:
parent
9220c40d24
commit
dbabc4561b
12
src/main/java/org/dbms/storageContracts/ICarStorage.java
Normal file
12
src/main/java/org/dbms/storageContracts/ICarStorage.java
Normal 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);
|
||||
}
|
15
src/main/java/org/dbms/storageContracts/IClientStorage.java
Normal file
15
src/main/java/org/dbms/storageContracts/IClientStorage.java
Normal 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);
|
||||
}
|
19
src/main/java/org/dbms/storageContracts/IDriverStorage.java
Normal file
19
src/main/java/org/dbms/storageContracts/IDriverStorage.java
Normal 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);
|
||||
}
|
16
src/main/java/org/dbms/storageContracts/IOrderStorage.java
Normal file
16
src/main/java/org/dbms/storageContracts/IOrderStorage.java
Normal 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);
|
||||
}
|
13
src/main/java/org/dbms/storageContracts/IParkingStorage.java
Normal file
13
src/main/java/org/dbms/storageContracts/IParkingStorage.java
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user