@Override public Query<T> apply(FetchPath fetchPath) { return query.apply(fetchPath); }
@Override public void applyPath(Query<T> query) { query.apply(docStructure.doc()); }
/** * Apply the path properties replacing the select and fetch clauses. * <p> * This is typically used when the PathProperties is applied to both the query and the JSON output. * </p> */ public R apply(PathProperties pathProperties) { query.apply(pathProperties); return root; }
@Override public EbeanQuery<MODEL_TYPE> apply(FetchPath fetchPath) { q.apply(fetchPath); return this; }
@Override public Query<T> apply(FetchPath fetchPath) { return query.apply(fetchPath); }
/** * {@inheritDoc} */ public Query<T> apply(PathProperties pathProperties) { return query().apply(pathProperties); }
@Override public void applyPath(Query<T> query) { query.apply(docStructure.doc()); }
private Query<T> query(String fetchPath) { Query<T> query = query(); if (StringUtils.hasText(fetchPath)) { query.apply(PathProperties.parse(fetchPath)); } return query; }
private <S extends T> Query<S> queryByExample(String fetchPath, Example<S> example) { Query<S> query = queryByExample(example); if (StringUtils.hasText(fetchPath)) { query.apply(PathProperties.parse(fetchPath)); } return query; }
private <S extends T> Query<S> queryByExample(String fetchPath, Example<S> example) { Query<S> query = queryByExample(example); if (StringUtils.hasText(fetchPath)) { query.apply(PathProperties.parse(fetchPath)); } return query; }
private Query<T> query(String fetchPath) { Query<T> query = query(); if (StringUtils.hasText(fetchPath)) { query.apply(PathProperties.parse(fetchPath)); } return query; }
private static <T> Query<T> query(EbeanServer ebeanServer, Class<T> entityType, String fetchPath, Object queryObject, Pageable pageable) { Assert.notNull(ebeanServer, "ebeanServer must not null"); Assert.notNull(entityType, "entityType must not null"); Query<T> query = ebeanServer.find(entityType); if (StringUtils.hasText(fetchPath)) { query.apply(PathProperties.parse(fetchPath)); } else { // queryObject IncludePath if (queryObject != null) { if (queryObject.getClass().isAnnotationPresent(IncludeFields.class)) { IncludeFields includeFields = queryObject.getClass().getAnnotation(IncludeFields.class); String ifs = includeFields.value(); if (StringUtils.hasText(ifs)) { query.apply(PathProperties.parse(ifs)); } } } } ExpressionList<T> expressionList = query.where(); applyWhere(expressionList, queryObject); if (pageable != null) { expressionList.setMaxRows(pageable.getPageSize()) .setFirstRow((int) pageable.getOffset()) .setOrder(Converters.convertToEbeanOrderBy(pageable.getSort())); } return expressionList.query(); }
private static <T> Query<T> query(EbeanServer ebeanServer, Class<T> entityType, String fetchPath, Object queryObject, Pageable pageable) { Assert.notNull(ebeanServer, "ebeanServer must not null"); Assert.notNull(entityType, "entityType must not null"); Query<T> query = ebeanServer.find(entityType); if (StringUtils.hasText(fetchPath)) { query.apply(PathProperties.parse(fetchPath)); } else { // queryObject IncludePath if (queryObject != null) { if (queryObject.getClass().isAnnotationPresent(IncludeFields.class)) { IncludeFields includeFields = queryObject.getClass().getAnnotation(IncludeFields.class); String ifs = includeFields.value(); if (StringUtils.hasText(ifs)) { query.apply(PathProperties.parse(ifs)); } } } } ExpressionList<T> expressionList = query.where(); applyWhere(expressionList, queryObject); if (pageable != null) { expressionList.setMaxRows(pageable.getPageSize()) .setFirstRow((int) pageable.getOffset()) .setOrder(Converters.convertToEbeanOrderBy(pageable.getSort())); } return expressionList.query(); }