A dynamic query object based on Javas Criteria (Hibernate) adapted for JavaScripts asynchronous nature with conditional next logic