diff options
author | Tharre <tharre3@gmail.com> | 2018-05-03 20:00:55 +0200 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2018-05-03 20:00:55 +0200 |
commit | 1426adba7e44cefbd8e4579b0c5bd03be8a57605 (patch) | |
tree | bc8bc01bc2a4eeec24031d24ebf1f01cb25d3e4d /src | |
parent | 5403d03b79a60d74bc942a982f31ba969e0171ca (diff) | |
download | sepm-groupproject-1426adba7e44cefbd8e4579b0c5bd03be8a57605.tar.gz sepm-groupproject-1426adba7e44cefbd8e4579b0c5bd03be8a57605.tar.xz sepm-groupproject-1426adba7e44cefbd8e4579b0c5bd03be8a57605.zip |
Allow multiple registrations at once
Otherwise, proper validation wouldn't be possible.
Diffstat (limited to 'src')
2 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDAO.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDAO.java index f2c461a..ba8f909 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDAO.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDAO.java @@ -3,6 +3,7 @@ package at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dao; import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Registration; import at.ac.tuwien.sepm.assignment.groupphase.exception.ElementNotFoundException; import at.ac.tuwien.sepm.assignment.groupphase.exception.PersistenceException; +import java.util.List; public interface RegistrationDAO { @@ -10,11 +11,11 @@ public interface RegistrationDAO { * Persist the given registration. * * @param vehicleId the id of the target vehicle - * @param registration that should be stored - * @return the id that was assigned + * @param registrations that should be stored + * @return a list of the ids that were assigned * @throws PersistenceException if the registration could not be persisted */ - long add(long vehicleId, Registration registration) throws PersistenceException; + List<Long> add(long vehicleId, List<Registration> registrations) throws PersistenceException; /** * Make registration with the given id inactive. diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/RegistrationService.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/RegistrationService.java index 6723f32..801148c 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/RegistrationService.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/RegistrationService.java @@ -4,6 +4,7 @@ import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Registratio import at.ac.tuwien.sepm.assignment.groupphase.exception.InvalidRegistrationException; import at.ac.tuwien.sepm.assignment.groupphase.exception.InvalidVehicleException; import at.ac.tuwien.sepm.assignment.groupphase.exception.ServiceException; +import java.util.List; public interface RegistrationService { @@ -11,13 +12,13 @@ public interface RegistrationService { * Register employee to a vehicle. * * @param vehicleId the id of the target vehicle - * @param registration that should be added to the vehicle - * @return the id that was assigned + * @param registrations that should be added to the vehicle + * @return a list of the ids that were assigned * @throws InvalidVehicleException if the vehicleId is invalid or does not exist * @throws InvalidRegistrationException if the registration is invalid * @throws ServiceException if the registration could not be persisted */ - long add(long vehicleId, Registration registration) + List<Long> add(long vehicleId, List<Registration> registrations) throws InvalidVehicleException, InvalidRegistrationException, ServiceException; /** |