- Create class
Car
. - Create
CarService
interface with implementation.
- Car create(Car car);
- Car get(Long id);
- List<Car> getAll();
- Car update(Car car);
- boolean delete(Long id);
- void addDriverToCar(Driver driver, Car car);
- void removeDriverFromCar(Driver driver, Car car);
- List<Car> getAllByDriver(Long driverId);
- Test your solution in the
main
method. - Don't forget about a table's and columns' namings.
- These methods should be only on the service layer:
- void addDriverToCar(Driver driver, Car car);
- void removeDriverFromCar(Driver driver, Car car);
Before submitting solution make sure you checked it first with checklist