package eu.eudat.controllers.publicapi; import eu.eudat.controllers.publicapi.jpa.predicates.*; import eu.eudat.controllers.publicapi.types.SelectionField; import jakarta.persistence.criteria.Join; import jakarta.persistence.criteria.JoinType; import jakarta.persistence.criteria.Subquery; import javax.management.InvalidApplicationException; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; public interface QueryableList { QueryableList where(SinglePredicate predicate); List select(SelectPredicate predicate) throws InvalidApplicationException; CompletableFuture> selectAsync(SelectPredicate predicate) throws InvalidApplicationException; List toList() throws InvalidApplicationException; void update(EntitySelectPredicate selectPredicate, V value) throws InvalidApplicationException; QueryableList withFields(List fields); List toListWithFields(); CompletableFuture> toListAsync() throws InvalidApplicationException; T getSingle() throws InvalidApplicationException; CompletableFuture getSingleAsync() throws InvalidApplicationException; T getSingleOrDefault() throws InvalidApplicationException; CompletableFuture getSingleOrDefaultAsync() throws InvalidApplicationException; QueryableList skip(Integer offset); QueryableList take(Integer length); QueryableList distinct(); QueryableList orderBy(OrderByPredicate predicate); QueryableList groupBy(GroupByPredicate predicate); QueryableList withHint(String hint); Long count() throws InvalidApplicationException; QueryableList where(NestedQuerySinglePredicate predicate); CompletableFuture countAsync() throws InvalidApplicationException; Subquery query(List fields) throws InvalidApplicationException; Subquery subQuery(SinglePredicate predicate, List fields) throws InvalidApplicationException; Subquery subQuery(NestedQuerySinglePredicate predicate, List fields); Subquery subQueryCount(NestedQuerySinglePredicate predicate, List fields); Subquery subQueryCount(SinglePredicate predicate, List fields) throws InvalidApplicationException; QueryableList initSubQuery(Class uClass); Subquery subQueryMax(SinglePredicate predicate, List fields, Class uClass) throws InvalidApplicationException; Subquery subQueryMax(NestedQuerySinglePredicate predicate, List fields, Class uClass); Join getJoin(String field, JoinType type); }