2017-12-17 22:34:24 +01:00
|
|
|
package eu.eudat.queryable;
|
|
|
|
|
|
|
|
|
2018-01-02 09:36:40 +01:00
|
|
|
import eu.eudat.entities.DataEntity;
|
2017-12-17 22:34:24 +01:00
|
|
|
import eu.eudat.queryable.predicates.OrderByPredicate;
|
|
|
|
import eu.eudat.queryable.predicates.SelectPredicate;
|
|
|
|
import eu.eudat.queryable.predicates.SinglePredicate;
|
|
|
|
|
2018-01-02 09:36:40 +01:00
|
|
|
import javax.xml.crypto.Data;
|
2017-12-17 22:34:24 +01:00
|
|
|
import java.util.List;
|
2018-01-02 09:36:40 +01:00
|
|
|
import java.util.Set;
|
2017-12-17 22:34:24 +01:00
|
|
|
|
2018-01-02 09:36:40 +01:00
|
|
|
public interface QueryableList<T extends DataEntity<T>> {
|
2017-12-17 22:34:24 +01:00
|
|
|
QueryableList<T> where(SinglePredicate<T> predicate);
|
|
|
|
|
|
|
|
<R> List<R> select(SelectPredicate<T, R> predicate);
|
|
|
|
|
|
|
|
List<T> toList();
|
|
|
|
|
2018-01-19 10:31:05 +01:00
|
|
|
T getSingle();
|
|
|
|
|
2017-12-17 22:34:24 +01:00
|
|
|
QueryableList<T> skip(Integer offset);
|
|
|
|
|
|
|
|
QueryableList<T> take(Integer length);
|
|
|
|
|
|
|
|
QueryableList<T> distinct();
|
|
|
|
|
2017-12-23 16:56:05 +01:00
|
|
|
QueryableList<T> orderByAsc(OrderByPredicate<T> predicate);
|
|
|
|
QueryableList<T> orderByDesc(OrderByPredicate<T> predicate);
|
2018-01-02 09:36:40 +01:00
|
|
|
QueryableList<T> setHints(Set<String> hints);
|
2018-01-19 10:31:05 +01:00
|
|
|
QueryableList<T> withHint(String hint);
|
2017-12-19 15:09:49 +01:00
|
|
|
Long count();
|
2017-12-17 22:34:24 +01:00
|
|
|
}
|