Skip to content
Snippets Groups Projects
Commit 2ea7d076 authored by Benedikt Elser's avatar Benedikt Elser
Browse files

Fixes

parent b963df9c
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,7 @@ public class BootController {
* @return Success or error
*/
@Operation(summary = "Create or modify a boat")
@Parameter(name="boot", required = true)
@io.swagger.v3.oas.annotations.parameters.RequestBody(description="Das Boot was gespeichert werde soll")
@RequestMapping(value="/", method={RequestMethod.POST, RequestMethod.PUT})
@ResponseBody
public ResponseEntity<Boot> rest_save(
......
......@@ -19,7 +19,7 @@ public interface FahrtRepository extends CrudRepository<Fahrt, Long> {
List<Fahrt> findByAnkunftIsNull();
@Query("select f from Fahrt f where f.ruderer = ?1")
@Query("select distinct f from Fahrt f JOIN f.ruderer r where r = ?1")
List<Fahrt> findByRuderer(Person person);
}
......@@ -58,7 +58,7 @@ public class PersonService {
public void delete(Long id) throws DaoException {
Person ruderer = personRepository.findById(id).get();
boolean keineFahrt = fahrtRepository.findByRuderer(ruderer ).isEmpty();
boolean keineFahrt = fahrtRepository.findByRuderer(ruderer).isEmpty();
if (keineFahrt) {
personRepository.deleteById(id);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment