19 package org.turro.jpa.query;
21 import java.util.List;
22 import javax.persistence.criteria.CriteriaQuery;
23 import javax.persistence.criteria.Order;
24 import javax.persistence.criteria.Path;
25 import javax.persistence.criteria.Selection;
37 this.jpaCriteria = jpaCriteria;
49 Path selection =
null;
50 for(
int i = 0; i < columns.length; i++) {
52 selection =
root().get(columns[i]);
53 }
else if(selection !=
null) {
54 selection = selection.get(columns[i]);
57 ((CriteriaQuery<E>)
query).select(selection);
62 ((CriteriaQuery<E>)
query).select(selection);
67 ((CriteriaQuery<E>)
query).multiselect(selections);
72 ((CriteriaQuery<E>)
query).multiselect(selectionList);
77 ((CriteriaQuery<E>)
query).orderBy(o);
82 ((CriteriaQuery<E>)
query).orderBy(o);
90 private void initQuery() {
final Class< E > persistentClass
JpaQuery< E > select(Selection<? extends E > selection)
JpaQuery< E > orderBy(Order... o)
JpaQuery(Class< E > javaClass, JpaCriteria jpaCriteria)
JpaQuery< E > orderBy(List o)
JpaQuery< E > multiselect(Selection<?>... selections)
JpaQuery< E > select(String... columns)
JpaQuery< E > multiselect(List< Selection<?>> selectionList)