use of org.eclipse.persistence.queries.LoadGroup in project cuba by cuba-platform.
the class FetchGroupManager method addView.
public void addView(JpaQuery query, String queryString, View view, boolean singleResultExpected) {
Preconditions.checkNotNullArgument(query, "query is null");
Preconditions.checkNotNullArgument(view, "view is null");
Map<String, Object> hints = query.getHints();
AttributeGroup ag = null;
if (view.loadPartialEntities()) {
if (hints != null)
ag = (FetchGroup) hints.get(QueryHints.FETCH_GROUP);
if (ag == null)
ag = new FetchGroup();
} else {
if (hints != null)
ag = (LoadGroup) hints.get(QueryHints.LOAD_GROUP);
if (ag == null)
ag = new LoadGroup();
}
applyView(query, queryString, ag, view, singleResultExpected);
}
use of org.eclipse.persistence.queries.LoadGroup in project cuba by cuba-platform.
the class FetchGroupManager method setView.
public void setView(JpaQuery query, String queryString, @Nullable View view, boolean singleResultExpected) {
Preconditions.checkNotNullArgument(query, "query is null");
if (view != null) {
AttributeGroup ag = view.loadPartialEntities() ? new FetchGroup() : new LoadGroup();
applyView(query, queryString, ag, view, singleResultExpected);
} else {
query.setHint(QueryHints.FETCH_GROUP, null);
}
}
Aggregations