//Read the one field, as required by the following rule:
// # vi. At least the randomNumber field must be read from the database result set.
@GET
    @Path("updates")
    public Uni<Collection<World>> updates(@QueryParam("queries") String queries) {
        return worldRepository.inSession(session -> {
            // FIXME: not supported
            //          session.setJdbcBatchSize(worlds.size());
            session.setFlushMode(FlushMode.MANUAL);
            var worlds = randomWorldForRead(session, parseQueryCount(queries));
            return worlds.flatMap(worldsCollection -> {
                worldsCollection.forEach( w -> {
                    //Read the one field, as required by the following rule:
                    // # vi. At least the randomNumber field must be read from the database result set.
                    final int previousRead = w.getRandomNumber();
                    //Update it, but make sure to exclude the current number as Hibernate optimisations would have us "fail"
                    //the verification:
                    w.setRandomNumber(randomWorldNumber(previousRead));
                } );
                return worldRepository.update(session, worldsCollection);
            });
        });
    }
return worlds.flatMap(worldsCollection -> {
worldsCollection.forEach( w -> {
//Read the one field, as required by the following rule:
// # vi. At least the randomNumber field must be read from the database result set.
final int previousRead = w.getRandomNumber();
//Update it, but make sure to exclude the current number as Hibernate optimisations would have us "fail"
@GET
@Path("updates")
public Uni<Collection<World>> updates(@QueryParam("queries") String queries) {
return worldRepository.inSession(session -> {
// FIXME: not supported
// session.setJdbcBatchSize(worlds.size());
session.setFlushMode(FlushMode.MANUAL);
var worlds = randomWorldForRead(session, parseQueryCount(queries));
return worlds.flatMap(worldsCollection -> {
worldsCollection.forEach( w -> {
//Read the one field, as required by the following rule:
// # vi. At least the randomNumber field must be read from the database result set.
final int previousRead = w.getRandomNumber();
//Update it, but make sure to exclude the current number as Hibernate optimisations would have us "fail"
//the verification:
w.setRandomNumber(randomWorldNumber(previousRead));
} );
return worldRepository.update(session, worldsCollection);
});
});
}
@GET
@Path("updates")
public Uni<Collection<World>> updates(@QueryParam("queries") String queries) {
return worldRepository.inSession(session -> {
// FIXME: not supported
// session.setJdbcBatchSize(worlds.size());
session.setFlushMode(FlushMode.MANUAL);
var worlds = randomWorldForRead(session, parseQueryCount(queries));
return worlds.flatMap(worldsCollection -> {
worldsCollection.forEach( w -> {
//Read the one field, as required by the following rule:
// # vi. At least the randomNumber field must be read from the database result set.
final int previousRead = w.getRandomNumber();
//Update it, but make sure to exclude the current number as Hibernate optimisations would have us "fail"
//the verification:
w.setRandomNumber(randomWorldNumber(previousRead));
} );
return worldRepository.update(session, worldsCollection);
});
});
}