@Override protected <T,R> Expression getOrderByExpression(CriteriaQuery<R> query, Class<T> queryType, String orderByListId) { List<Selection<?>> selections = query.getSelection().getCompoundSelectionItems(); Selection orderBySelection = null; if( orderByListId.equals(QueryParameterIdentifiers.TASK_ID_LIST) ) { orderBySelection = selections.get(0); } else if( orderByListId.equals(QueryParameterIdentifiers.TASK_NAME_LIST) ) { orderBySelection = selections.get(1); } else if( orderByListId.equals(QueryParameterIdentifiers.TASK_STATUS_LIST) ) { orderBySelection = selections.get(4); } else if( orderByListId.equals(QueryParameterIdentifiers.CREATED_BY_LIST) ) { orderBySelection = selections.get(8); } else if( orderByListId.equals(QueryParameterIdentifiers.CREATED_ON_LIST) ) { orderBySelection = selections.get(9); } else if( orderByListId.equals(QueryParameterIdentifiers.PROCESS_INSTANCE_ID_LIST) ) { orderBySelection = selections.get(14); } return (Expression<?>) orderBySelection; }
@Override protected <T,R> Expression getOrderByExpression(CriteriaQuery<R> query, Class<T> queryType, String orderByListId) { List<Selection<?>> selections = query.getSelection().getCompoundSelectionItems(); Selection orderBySelection = null; if( orderByListId.equals(QueryParameterIdentifiers.TASK_ID_LIST) ) { orderBySelection = selections.get(0); } else if( orderByListId.equals(QueryParameterIdentifiers.TASK_NAME_LIST) ) { orderBySelection = selections.get(1); } else if( orderByListId.equals(QueryParameterIdentifiers.TASK_STATUS_LIST) ) { orderBySelection = selections.get(4); } else if( orderByListId.equals(QueryParameterIdentifiers.CREATED_BY_LIST) ) { orderBySelection = selections.get(8); } else if( orderByListId.equals(QueryParameterIdentifiers.CREATED_ON_LIST) ) { orderBySelection = selections.get(9); } else if( orderByListId.equals(QueryParameterIdentifiers.PROCESS_INSTANCE_ID_LIST) ) { orderBySelection = selections.get(14); } return (Expression<?>) orderBySelection; }
@Override public void addSelection(Expression<?> expression, String name) { Selection<?> selection = criteriaQuery.getSelection(); List<Selection<?>> newSelection = new ArrayList<>(); if (selection != null) { if (selection.isCompoundSelection()) { newSelection.addAll(selection.getCompoundSelectionItems()); } else { newSelection.add(selection); } } newSelection.add(expression); criteriaQuery.multiselect(newSelection); }
protected void findRootAndParameters(Selection<?> selection) { if (selection.isCompoundSelection()) { for (Selection subSelection : selection.getCompoundSelectionItems()) { findRootAndParameters(subSelection); } } }
getProjections(exps, s.getCompoundSelectionItems(), projections, aliases, clauses, factory, q, model, exp2Vals); } else {
getProjections(exps, s.getCompoundSelectionItems(), projections, aliases, clauses, factory, q, model, exp2Vals); } else {
getProjections(exps, s.getCompoundSelectionItems(), projections, aliases, clauses, factory, q, model, exp2Vals); } else {
getProjections(exps, s.getCompoundSelectionItems(), projections, aliases, clauses, factory, q, model, exp2Vals); } else {
this.queryType = Tuple.class; } else if (((InternalSelection) selection).isConstructor()) { Selection[] selectArray = selection.getCompoundSelectionItems().toArray(new Selection[selection.getCompoundSelectionItems().size()]); populateAndSetConstructorSelection((ConstructorSelectionImpl)selection, this.selection.getJavaType(), selectArray); this.queryType = selection.getJavaType();
for (Selection<?> s : selection.getCompoundSelectionItems()) { renderSelection(cb, context, s, treatedSelections); ((CriteriaBuilder) cb).selectNew(new JpaTupleObjectBuilder(selection.getCompoundSelectionItems()) { @Override protected void renderSelection(SelectBuilder<?> cb, Selection<?> s) { for (Selection<?> s : selection.getCompoundSelectionItems()) { renderSelection(cb, context, s, treatedSelections); for (Selection<?> s : selection.getCompoundSelectionItems()) { if (s instanceof Subquery<?>) { if (s.getAlias() != null) {
for (Selection<?> s : selection.getCompoundSelectionItems()) { renderSelection(cb, context, s, treatedSelections); ((CriteriaBuilder) cb).selectNew(new JpaTupleObjectBuilder(selection.getCompoundSelectionItems()) { @Override protected void renderSelection(SelectBuilder<?> cb, Selection<?> s) { for (Selection<?> s : selection.getCompoundSelectionItems()) { renderSelection(cb, context, s, treatedSelections); for (Selection<?> s : selection.getCompoundSelectionItems()) { if (s instanceof Subquery<?>) { if (s.getAlias() != null) {