@Test public void findPunishmentData() { UUID uuid = UUID.randomUUID(); PunishmentData punishmentData = new PunishmentData(uuid); PlayerProfile target = createProfile(uuid); punishmentData.addPunishment(ActivePunishmentType.MUTE, new ActivePunishmentRecord("punisher", target, "reason", LocalDateTime.now(), ActivePunishmentType.MUTE)); repository.save(punishmentData); final Optional<PunishmentData> fetchedData = repository.findPunishmentData(uuid); assertTrue(fetchedData.isPresent()); fetchedData.ifPresent(pd -> assertTrue( pd.getPunishment(ActivePunishmentType.MUTE).isPresent())); }
public Optional<PunishmentData> findPunishmentData(UUID uuid) { return ebeanServer.createQuery(PunishmentData.class) .fetch("activePunishments") .setId(uuid) .findOneOrEmpty(); }
PunishmentDataRepository { public Optional<PunishmentData> findPunishmentData(UUID uuid) { return ebeanServer.createQuery(PunishmentData.class) .fetch("activePunishments") .setId(uuid) .findOneOrEmpty(); } }
PunishmentDataRepository { public Optional<PunishmentData> findPunishmentData(UUID uuid) { return ebeanServer.createQuery(PunishmentData.class) .fetch("activePunishments") .setId(uuid) .findOneOrEmpty(); }  }
PunishmentDataRepository { public Optional<PunishmentData> findPunishmentData(UUID uuid) { return ebeanServer.createQuery(PunishmentData.class) .fetch("activePunishments") .setId(uuid) .findOneOrEmpty(); }  Optional<PunishmentData> findPunishmentData(UUID uuid); void put(UUID uuid, PunishmentData punishmentData); Optional<PunishmentData> getPunishmentData(UUID uuid); void update(PunishmentData punishmentData); void save(PunishmentData punishmentData); void invalidate(UUID uuid); }
PunishmentDataRepository { public Optional<PunishmentData> findPunishmentData(UUID uuid) { return ebeanServer.createQuery(PunishmentData.class) .fetch("activePunishments") .setId(uuid) .findOneOrEmpty(); }  Optional<PunishmentData> findPunishmentData(UUID uuid); void put(UUID uuid, PunishmentData punishmentData); Optional<PunishmentData> getPunishmentData(UUID uuid); void update(PunishmentData punishmentData); void save(PunishmentData punishmentData); void invalidate(UUID uuid);  }