Code review comment: ```suggestion                                     "Should have thrown sort exception")) ```

Code under review:
public Uni<String> testModelDao() {
        return personDao.findAll().list()
                .flatMap(persons -> {
                    Assertions.assertEquals(0, persons.size());

                    return personDao.listAll();
                }).flatMap(persons -> {
                    Assertions.assertEquals(0, persons.size());

                    return collect(personDao.findAll().stream());
                }).flatMap(personStream -> {
                    Assertions.assertEquals(0, personStream.size());

                    return collect(personDao.streamAll());
                }).flatMap(personStream -> {

                    Assertions.assertEquals(0, personStream.size());
                    return assertThrows(NoResultException.class, () -> personDao.findAll().singleResult(),
                            "singleResult should have thrown");
                }).flatMap(v -> personDao.findAll().firstResult())
                .flatMap(result -> {
                    Assertions.assertNull(result);

                    return makeSavedPersonDao();
                }).flatMap(person -> {
                    Assertions.assertNotNull(person.id);

                    return personDao.count()
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                return personDao.count("name = ?1", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                return personDao.count("name = :name", Parameters.with("name", "stef").map());
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                return personDao.count("name = :name", Parameters.with("name", "stef"));
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                return personDao.count("name", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                return dogDao.count();
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                
                                Assertions.assertEquals(1, person.dogs.size());

                                return personDao.findAll().list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.listAll();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.findAll().stream());
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.streamAll());
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.findAll().firstResult();
                            }).flatMap(personResult -> {
                                Assertions.assertEquals(person, personResult);

                                return personDao.findAll().singleResult();
                            }).flatMap(personResult -> {
                                Assertions.assertEquals(person, personResult);

                                return personDao.find("name = ?1", "stef").list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name = ?1", "stef").withLock(LockModeType.PESSIMISTIC_READ).list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                
                                
                                
                                
                                
                                

                                return personDao.list("name = ?1", "stef");
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name = :name", Parameters.with("name", "stef").map()).list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name = :name", Parameters.with("name", "stef")).list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.list("name = :name", Parameters.with("name", "stef").map());
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name = :name", Parameters.with("name", "stef").map()).list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.list("name = :name", Parameters.with("name", "stef"));
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name", "stef").list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.find("name = ?1", "stef").stream());
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.stream("name = ?1", "stef"));
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.stream("name = :name", Parameters.with("name", "stef").map()));
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.stream("name = :name", Parameters.with("name", "stef")));
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.find("name", "stef").stream());
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name", "stef").firstResult();
                            }).flatMap(personResult -> {
                                Assertions.assertEquals(person, personResult);

                                return personDao.find("name", "stef").singleResult();
                            }).flatMap(personResult -> {
                                Assertions.assertEquals(person, personResult);

                                return personDao.find("name", "stef").singleResult();
                            }).flatMap(personResult -> {
                                Assertions.assertEquals(person, personResult);

                                
                                return personDao.list("
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return assertThrows(PanacheQueryException.class,
                                        () -> personDao.find("
                                        "singleResult should have thrown");
                            }).flatMap(v -> assertThrows(IllegalArgumentException.class,
                                    () -> personDao.list("
                                    "sort should hav thrown"))
                            .flatMap(v -> namedQueryRepository.list("
                            .flatMap(v -> namedQueryRepository.list("
                            .flatMap(v -> namedQueryWith2QueriesRepository.list("
                            .flatMap(v -> namedQueryWith2QueriesRepository.list("
                            .flatMap(v -> {
                                
                                return personDao.find("").list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find(null).list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.findById(person.id);
                            }).flatMap(byId -> {
                                Assertions.assertEquals(person, byId);
                                Assertions.assertEquals("Person<" + person.id + ">", byId.toString());

                                return personDao.findById(person.id, LockModeType.PESSIMISTIC_READ);
                            }).flatMap(byId -> {
                                Assertions.assertEquals(person, byId);
                                Assertions.assertEquals("Person<" + person.id + ">", byId.toString());

                                return person.delete();
                            }).flatMap(v -> personDao.count())
                            .flatMap(count -> {
                                Assertions.assertEquals(0, count);

                                return makeSavedPersonDao();
                            })

                            .flatMap(v -> Person.count("
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.count("
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.count("
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.count("
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Uni.createFrom().voidItem();
                                    }))
                            .flatMap(voidUni -> Person.update("
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("
                                    }).flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.update("
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("
                                    }).flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.update("
                                                Parameters.with("name", "stef2").and("id", ((Person) persons.get(0)).id).map());
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("
                                    }).flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.update("
                                                Parameters.with("name", "stef3").and("id", ((Person) persons.get(0)).id));
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("
                                    }).flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.update("
                                                ((Person) persons.get(0)).id);
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("
                                    }).flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Uni.createFrom().voidItem();
                                    }))
                            .flatMap(voidUni -> Dog.deleteAll()
                                    .flatMap(v -> Person.delete("
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("").list();
                                    })
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(0, persons.size());
                                        return Uni.createFrom().voidItem();
                                    }))
                            .flatMap(voidUni -> makeSavedPerson().flatMap(personToDelete -> Dog.deleteAll()
                                    .flatMap(v -> Person.find("").list())
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.delete("
                                                Parameters.with("id", personToDelete.id).map());
                                    })
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("").list();
                                    })
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(0, persons.size());
                                        return Uni.createFrom().voidItem();
                                    })))
                            .flatMap(voidUni -> makeSavedPerson().flatMap(personToDelete -> Dog.deleteAll()
                                    .flatMap(v -> Person.find("").list())
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.delete("
                                    })
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("").list();
                                    })
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(0, persons.size());
                                        return Uni.createFrom().voidItem();
                                    })))
                            .flatMap(voidUni -> makeSavedPerson().flatMap(personToDelete -> Dog.deleteAll()
                                    .flatMap(v -> Person.find("").list())
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.delete("
                                    })
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("").list();
                                    })
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(0, persons.size());
                                        return makeSavedPersonDao();
                                    })));

                }).flatMap(person -> {

                    return personDao.count()
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("name = ?1", "emmanuel");
                            }).flatMap(count -> {
                                Assertions.assertEquals(0, count);

                                return dogDao.delete("owner = ?1", person);
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("name", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return makeSavedPersonDao();
                            });
                }).flatMap(person -> {

                    return dogDao.delete("owner = :owner", Parameters.with("owner", person).map())
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("name", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return makeSavedPersonDao();
                            });
                }).flatMap(person -> {

                    return dogDao.delete("owner = :owner", Parameters.with("owner", person))
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("name", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return makeSavedPersonDao();
                            });
                }).flatMap(person -> {

                    
                    return dogDao.delete("FROM Dog WHERE owner = :owner", Parameters.with("owner", person))
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("FROM Person2 WHERE name = ?1", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return makeSavedPersonDao();
                            });
                }).flatMap(person -> {

                    return dogDao.delete("DELETE FROM Dog WHERE owner = :owner", Parameters.with("owner", person))
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("DELETE FROM Person2 WHERE name = ?1", "stef");
                            }).map(count -> {
                                Assertions.assertEquals(1, count);

                                return null;
                            });
                })
                .flatMap(v -> personDao.deleteAll())
                .flatMap(count -> {
                    Assertions.assertEquals(0, count);

                    return makeSavedPersonDao();
                }).flatMap(person -> {

                    return dogDao.deleteAll()
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.deleteAll();
                            }).map(count -> {
                                Assertions.assertEquals(1, count);

                                return null;
                            });
                })
                .flatMap(v -> testPersistDao(PersistTest.Iterable))
                .flatMap(v -> testPersistDao(PersistTest.Stream))
                .flatMap(v -> testPersistDao(PersistTest.Variadic))
                .flatMap(v -> personDao.deleteAll())
                .flatMap(count -> {
                    Assertions.assertEquals(6, count);

                    return testSorting();
                })
                
                .flatMap(v -> makeSavedPersonDao("0"))
                .flatMap(v -> makeSavedPersonDao("1"))
                .flatMap(v -> makeSavedPersonDao("2"))
                .flatMap(v -> makeSavedPersonDao("3"))
                .flatMap(v -> makeSavedPersonDao("4"))
                .flatMap(v -> makeSavedPersonDao("5"))
                .flatMap(v -> makeSavedPersonDao("6"))
                .flatMap(v -> testPaging(personDao.findAll()))
                .flatMap(v -> testPaging(personDao.find("ORDER BY name")))
                
                .flatMap(v -> testRange(personDao.findAll()))
                .flatMap(v -> testRange(personDao.find("ORDER BY name")))
                .flatMap(v -> assertThrows(NonUniqueResultException.class,
                        () -> personDao.findAll().singleResult(),
                        "singleResult should have thrown"))
                .flatMap(v -> personDao.findAll().firstResult())
                .flatMap(person -> {
                    Assertions.assertNotNull(person);

                    return personDao.deleteAll();
                }).flatMap(count -> {
                    Assertions.assertEquals(7, count);

                    return testUpdateDao();
                }).flatMap(v -> {
                    
                    Person toRemove = new Person();
                    toRemove.name = "testDeleteById";
                    toRemove.uniqueName = "testDeleteByIdUnique";
                    return toRemove.persist().flatMap(v2 -> {
                        System.err.println("Calling DELETE for " + toRemove.id);
                        return personDao.deleteById(toRemove.id);
                    });
                }).flatMap(deleted -> {
                    assertTrue(deleted);

                    return personDao.deleteById(666L); 
                }).flatMap(deleted -> {
                    assertFalse(deleted);

                    
                    Person person1 = new Person();
                    person1.name = "testFLush1";
                    person1.uniqueName = "unique";
                    return personDao.persistAndFlush(person1);
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                }).flatMap(v -> {
                    System.err.println("DONE before delete ?");
                    return personDao.deleteAll();
                })
                .map(v -> {
                    System.err.println("deleted " + v);
                    return "OK";
                });
    }

Line commented on: "sort should hav thrown"))

Revised code:
public Uni<String> testModelDao() {
        return personDao.findAll().list()
                .flatMap(persons -> {
                    Assertions.assertEquals(0, persons.size());

                    return personDao.listAll();
                }).flatMap(persons -> {
                    Assertions.assertEquals(0, persons.size());

                    return collect(personDao.findAll().stream());
                }).flatMap(personStream -> {
                    Assertions.assertEquals(0, personStream.size());

                    return collect(personDao.streamAll());
                }).flatMap(personStream -> {

                    Assertions.assertEquals(0, personStream.size());
                    return assertThrows(NoResultException.class, () -> personDao.findAll().singleResult(),
                            "singleResult should have thrown");
                }).flatMap(v -> personDao.findAll().firstResult())
                .flatMap(result -> {
                    Assertions.assertNull(result);

                    return makeSavedPersonDao();
                }).flatMap(person -> {
                    Assertions.assertNotNull(person.id);

                    return personDao.count()
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                return personDao.count("name = ?1", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                return personDao.count("name = :name", Parameters.with("name", "stef").map());
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                return personDao.count("name = :name", Parameters.with("name", "stef"));
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                return personDao.count("name", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                return dogDao.count();
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);
                                
                                Assertions.assertEquals(1, person.dogs.size());

                                return personDao.findAll().list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.listAll();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.findAll().stream());
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.streamAll());
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.findAll().firstResult();
                            }).flatMap(personResult -> {
                                Assertions.assertEquals(person, personResult);

                                return personDao.findAll().singleResult();
                            }).flatMap(personResult -> {
                                Assertions.assertEquals(person, personResult);

                                return personDao.find("name = ?1", "stef").list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name = ?1", "stef").withLock(LockModeType.PESSIMISTIC_READ).list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                
                                
                                
                                
                                
                                

                                return personDao.list("name = ?1", "stef");
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name = :name", Parameters.with("name", "stef").map()).list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name = :name", Parameters.with("name", "stef")).list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.list("name = :name", Parameters.with("name", "stef").map());
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name = :name", Parameters.with("name", "stef").map()).list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.list("name = :name", Parameters.with("name", "stef"));
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name", "stef").list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.find("name = ?1", "stef").stream());
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.stream("name = ?1", "stef"));
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.stream("name = :name", Parameters.with("name", "stef").map()));
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.stream("name = :name", Parameters.with("name", "stef")));
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return collect(personDao.find("name", "stef").stream());
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find("name", "stef").firstResult();
                            }).flatMap(personResult -> {
                                Assertions.assertEquals(person, personResult);

                                return personDao.find("name", "stef").singleResult();
                            }).flatMap(personResult -> {
                                Assertions.assertEquals(person, personResult);

                                return personDao.find("name", "stef").singleResult();
                            }).flatMap(personResult -> {
                                Assertions.assertEquals(person, personResult);

                                
                                return personDao.list("
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return assertThrows(PanacheQueryException.class,
                                        () -> personDao.find("
                                        "singleResult should have thrown");
                            }).flatMap(v -> assertThrows(IllegalArgumentException.class,
                                    () -> personDao.list("
                                    "Should have thrown sort exception"))
                            .flatMap(v -> namedQueryRepository.list("
                            .flatMap(v -> namedQueryRepository.list("
                            .flatMap(v -> namedQueryWith2QueriesRepository.list("
                            .flatMap(v -> namedQueryWith2QueriesRepository.list("
                            .flatMap(v -> {
                                
                                return personDao.find("").list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.find(null).list();
                            }).flatMap(persons -> {
                                Assertions.assertEquals(1, persons.size());
                                Assertions.assertEquals(person, persons.get(0));

                                return personDao.findById(person.id);
                            }).flatMap(byId -> {
                                Assertions.assertEquals(person, byId);
                                Assertions.assertEquals("Person<" + person.id + ">", byId.toString());

                                return personDao.findById(person.id, LockModeType.PESSIMISTIC_READ);
                            }).flatMap(byId -> {
                                Assertions.assertEquals(person, byId);
                                Assertions.assertEquals("Person<" + person.id + ">", byId.toString());

                                return person.delete();
                            }).flatMap(v -> personDao.count())
                            .flatMap(count -> {
                                Assertions.assertEquals(0, count);

                                return makeSavedPersonDao();
                            })

                            .flatMap(v -> Person.count("
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.count("
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.count("
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.count("
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Uni.createFrom().voidItem();
                                    }))
                            .flatMap(voidUni -> Person.update("
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("
                                    }).flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.update("
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("
                                    }).flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.update("
                                                Parameters.with("name", "stef2").and("id", ((Person) persons.get(0)).id).map());
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("
                                    }).flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.update("
                                                Parameters.with("name", "stef3").and("id", ((Person) persons.get(0)).id));
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("
                                    }).flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.update("
                                                ((Person) persons.get(0)).id);
                                    }).flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("
                                    }).flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Uni.createFrom().voidItem();
                                    }))
                            .flatMap(voidUni -> Dog.deleteAll()
                                    .flatMap(v -> Person.delete("
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("").list();
                                    })
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(0, persons.size());
                                        return Uni.createFrom().voidItem();
                                    }))
                            .flatMap(voidUni -> makeSavedPerson().flatMap(personToDelete -> Dog.deleteAll()
                                    .flatMap(v -> Person.find("").list())
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.delete("
                                                Parameters.with("id", personToDelete.id).map());
                                    })
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("").list();
                                    })
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(0, persons.size());
                                        return Uni.createFrom().voidItem();
                                    })))
                            .flatMap(voidUni -> makeSavedPerson().flatMap(personToDelete -> Dog.deleteAll()
                                    .flatMap(v -> Person.find("").list())
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.delete("
                                    })
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("").list();
                                    })
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(0, persons.size());
                                        return Uni.createFrom().voidItem();
                                    })))
                            .flatMap(voidUni -> makeSavedPerson().flatMap(personToDelete -> Dog.deleteAll()
                                    .flatMap(v -> Person.find("").list())
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(1, persons.size());
                                        return Person.delete("
                                    })
                                    .flatMap(count -> {
                                        Assertions.assertEquals(1, count);
                                        return Person.find("").list();
                                    })
                                    .flatMap(persons -> {
                                        Assertions.assertEquals(0, persons.size());
                                        return makeSavedPersonDao();
                                    })));

                }).flatMap(person -> {

                    return personDao.count()
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("name = ?1", "emmanuel");
                            }).flatMap(count -> {
                                Assertions.assertEquals(0, count);

                                return dogDao.delete("owner = ?1", person);
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("name", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return makeSavedPersonDao();
                            });
                }).flatMap(person -> {

                    return dogDao.delete("owner = :owner", Parameters.with("owner", person).map())
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("name", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return makeSavedPersonDao();
                            });
                }).flatMap(person -> {

                    return dogDao.delete("owner = :owner", Parameters.with("owner", person))
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("name", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return makeSavedPersonDao();
                            });
                }).flatMap(person -> {

                    
                    return dogDao.delete("FROM Dog WHERE owner = :owner", Parameters.with("owner", person))
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("FROM Person2 WHERE name = ?1", "stef");
                            }).flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return makeSavedPersonDao();
                            });
                }).flatMap(person -> {

                    return dogDao.delete("DELETE FROM Dog WHERE owner = :owner", Parameters.with("owner", person))
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.delete("DELETE FROM Person2 WHERE name = ?1", "stef");
                            }).map(count -> {
                                Assertions.assertEquals(1, count);

                                return null;
                            });
                })
                .flatMap(v -> personDao.deleteAll())
                .flatMap(count -> {
                    Assertions.assertEquals(0, count);

                    return makeSavedPersonDao();
                }).flatMap(person -> {

                    return dogDao.deleteAll()
                            .flatMap(count -> {
                                Assertions.assertEquals(1, count);

                                return personDao.deleteAll();
                            }).map(count -> {
                                Assertions.assertEquals(1, count);

                                return null;
                            });
                })
                .flatMap(v -> testPersistDao(PersistTest.Iterable))
                .flatMap(v -> testPersistDao(PersistTest.Stream))
                .flatMap(v -> testPersistDao(PersistTest.Variadic))
                .flatMap(v -> personDao.deleteAll())
                .flatMap(count -> {
                    Assertions.assertEquals(6, count);

                    return testSorting();
                })
                
                .flatMap(v -> makeSavedPersonDao("0"))
                .flatMap(v -> makeSavedPersonDao("1"))
                .flatMap(v -> makeSavedPersonDao("2"))
                .flatMap(v -> makeSavedPersonDao("3"))
                .flatMap(v -> makeSavedPersonDao("4"))
                .flatMap(v -> makeSavedPersonDao("5"))
                .flatMap(v -> makeSavedPersonDao("6"))
                .flatMap(v -> testPaging(personDao.findAll()))
                .flatMap(v -> testPaging(personDao.find("ORDER BY name")))
                
                .flatMap(v -> testRange(personDao.findAll()))
                .flatMap(v -> testRange(personDao.find("ORDER BY name")))
                .flatMap(v -> assertThrows(NonUniqueResultException.class,
                        () -> personDao.findAll().singleResult(),
                        "singleResult should have thrown"))
                .flatMap(v -> personDao.findAll().firstResult())
                .flatMap(person -> {
                    Assertions.assertNotNull(person);

                    return personDao.deleteAll();
                }).flatMap(count -> {
                    Assertions.assertEquals(7, count);

                    return testUpdateDao();
                }).flatMap(v -> {
                    
                    Person toRemove = new Person();
                    toRemove.name = "testDeleteById";
                    toRemove.uniqueName = "testDeleteByIdUnique";
                    return toRemove.persist().flatMap(v2 -> {
                        System.err.println("Calling DELETE for " + toRemove.id);
                        return personDao.deleteById(toRemove.id);
                    });
                }).flatMap(deleted -> {
                    assertTrue(deleted);

                    return personDao.deleteById(666L); 
                }).flatMap(deleted -> {
                    assertFalse(deleted);

                    
                    Person person1 = new Person();
                    person1.name = "testFLush1";
                    person1.uniqueName = "unique";
                    return personDao.persistAndFlush(person1);
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                }).flatMap(v -> {
                    System.err.println("DONE before delete ?");
                    return personDao.deleteAll();
                })
                .map(v -> {
                    System.err.println("deleted " + v);
                    return "OK";
                });
    }