/** * Apply these path properties as fetch paths to the query. */ @Override public <T> void apply(Query<T> query) { for (Entry<String, Props> entry : pathMap.entrySet()) { String path = entry.getKey(); String props = entry.getValue().getPropertiesAsString(); if (path == null || path.isEmpty()) { query.select(props); } else { query.fetch(path, props); } } }
/** * Add to the query to fetch the Ids values for the foreign keys basically. */ void addSelectId(Query<?> query) { BeanProperty idProperty = targetDescriptor.getIdProperty(); query.fetch(fullPath, idProperty.getName()); }
/** * Fetch draftable element relationships. */ public void draftQueryOptimise(Query<T> query) { BeanPropertyAssocOne<?>[] one = desc.propertiesOne(); for (BeanPropertyAssocOne<?> anOne : one) { if (anOne.getTargetDescriptor().isDraftableElement()) { query.fetch(anOne.getName()); } } BeanPropertyAssocMany<?>[] many = desc.propertiesMany(); for (BeanPropertyAssocMany<?> aMany : many) { if (aMany.getTargetDescriptor().isDraftableElement()) { query.fetch(aMany.getName()); } } } }
@Override public EbeanQuery<MODEL_TYPE> fetch(String path) { q.fetch(path); return this; }
@Override public EbeanQuery<MODEL_TYPE> fetch(String assocProperty, String fetchProperties, FetchConfig fetchConfig) { q.fetch(assocProperty, fetchProperties, fetchConfig); return this; }
@Override public EbeanQuery<MODEL_TYPE> fetch(String path, String fetchProperties) { q.fetch(path, fetchProperties); return this; }
@Override public EbeanQuery<MODEL_TYPE> fetch(String path, FetchConfig joinConfig) { q.fetch(path, joinConfig); return this; }
/** * {@inheritDoc} * Specifies a path to fetch with a specific list properties to include, to load a partial object. */ public Query<T> fetch(String path, String fetchProperties) { return query().fetch(path, fetchProperties); }
/** * Eagerly fetch this association with the properties specified. */ public R fetch(String properties) { ((TQRootBean) _root).query().fetch(_name, properties); return _root; }
/** * {@inheritDoc} * Additionally specifies a <code>FetchConfig</code> to use a separate query or lazy loading to load this path. */ public Query<T> fetch(String assocProperty, String fetchProperties, FetchConfig fetchConfig) { return query().fetch(assocProperty, fetchProperties, fetchConfig); }
/** * {@inheritDoc} * <p> * Additionally specifies a <code>JoinConfig</code> to specify a 'query join' and/or define the lazy loading query. * * @param path a {@link java.lang.String} object. * @param joinConfig a {@link io.ebean.FetchConfig} object. * @return a {@link io.ebean.Query} object. */ public Query<T> fetch(String path, FetchConfig joinConfig) { return query().fetch(path, joinConfig); }
/** * Eagerly fetch this association fetching all the properties. */ public R fetch() { ((TQRootBean) _root).query().fetch(_name); return _root; }
/** * {@inheritDoc} * Specifies a path to load including all its properties. */ public Query<T> fetch(String path) { return query().fetch(path); }
/** * Eagerly fetch this association fetching some of the properties. */ protected R fetchProperties(TQProperty<?>... props) { ((TQRootBean) _root).query().fetch(_name, properties(props)); return _root; }
/** * Add to the query to fetch the Ids values for the foreign keys basically. */ void addSelectId(Query<?> query) { BeanProperty idProperty = targetDescriptor.getIdProperty(); query.fetch(fullPath, idProperty.getName()); }
/** {@inheritDoc} */ @Override public <T> void apply(final Query<T> query) { pathProperties.each(props -> { String path = props.getPath(); String propsStr = props.getPropertiesAsString(); if (path == null || path.isEmpty()) { query.select(propsStr); } else { query.fetch(path, propsStr); } }); } }