get kinosaal

This commit is contained in:
2025-10-24 23:34:56 +02:00
parent 295928b444
commit 516780e2c2
2 changed files with 14 additions and 2 deletions

View File

@@ -35,7 +35,7 @@
<dependency> <dependency>
<groupId>de.infinimotion</groupId> <groupId>de.infinimotion</groupId>
<artifactId>model-persistence</artifactId> <artifactId>model-persistence</artifactId>
<version>0.0.55</version> <version>0.0.56</version>
</dependency> </dependency>
<!-- Quarkus --> <!-- Quarkus -->

View File

@@ -10,11 +10,12 @@ import java.util.List;
@Unremovable @Unremovable
@ApplicationScoped @ApplicationScoped
public class KinosaalProcessor implements CommandListKinosaalProcessor, CommandCreateKinosaalProcessor, CommandUpdateKinosaalProcessor, CommandDeleteKinosaalProcessor { public class KinosaalProcessor implements CommandListKinosaalProcessor, CommandGetKinosaalProcessor, CommandCreateKinosaalProcessor, CommandUpdateKinosaalProcessor, CommandDeleteKinosaalProcessor {
@Inject @Inject
EntityManager em; EntityManager em;
@Override
public Command processCommandListKinosaal(CommandListKinosaal request) { public Command processCommandListKinosaal(CommandListKinosaal request) {
List<Kinosaal> results = em.createQuery("SELECT k FROM Kinosaal k", Kinosaal.class).getResultList(); List<Kinosaal> results = em.createQuery("SELECT k FROM Kinosaal k", Kinosaal.class).getResultList();
@@ -23,6 +24,16 @@ public class KinosaalProcessor implements CommandListKinosaalProcessor, CommandC
return response; return response;
} }
@Override
public Command processCommandGetKinosaal(CommandGetKinosaal request) throws Exception {
Kinosaal hall = em.find(Kinosaal.class, request.getId());
CommandGetKinosaalResponse response = new CommandGetKinosaalResponse();
response.setHall(hall);
return response;
}
@Override
public Command processCommandCreateKinosaal(CommandCreateKinosaal request) { public Command processCommandCreateKinosaal(CommandCreateKinosaal request) {
Kinosaal hall = new Kinosaal(); Kinosaal hall = new Kinosaal();
hall.setName(request.getName()); hall.setName(request.getName());
@@ -51,4 +62,5 @@ public class KinosaalProcessor implements CommandListKinosaalProcessor, CommandC
response.setHall(hall); response.setHall(hall);
return response; return response;
} }
} }