/** * Adds one or more aliases for the qualifier expression path. Aliases serve * to instruct Cayenne to generate separate sets of joins for overlapping * paths, that maybe needed for complex conditions. An example of an * <i>implicit</i> splits is this method: * {@link ExpressionFactory#matchAllExp(String, Object...)}. * * @since 3.0 */ public void aliasPathSplits(String path, String... aliases) { metaData.addPathSplitAliases(path, aliases); }
/** * Adds a prefetch with specified relationship path to the query. * * @since 1.2 signature changed to return created PrefetchTreeNode. */ public PrefetchTreeNode addPrefetch(String prefetchPath) { return metaData.addPrefetch(prefetchPath, PrefetchTreeNode.UNDEFINED_SEMANTICS); }
/** * Clears all stored prefetch paths. */ public void clearPrefetches() { metaData.clearPrefetches(); }
if(exp.getType() == Expression.OBJ_PATH) { Expression dbPath = this.getObjEntity().translateToDbPath(exp); DbRelationship rel = findRelationByPath(dbEntity, dbPath); if(rel != null && !rel.isToMany()) { if(getPageSize() > 0) { result.addEntityResult(buildEntityIdResultForColumn(column, resolver)); } else { result.addEntityResult(buildEntityResultForColumn(query, column, resolver));
boolean resolve(Object root, EntityResolver resolver, SelectQuery<?> query) { if (super.resolve(root, resolver, null)) { // generate unique cache key, but only if we are caching.. if (cacheStrategy != null && cacheStrategy != QueryCacheStrategy.NO_CACHE) { this.cacheKey = makeCacheKey(query, resolver); } resolveAutoAliases(query); buildResultSetMappingForColumns(query, resolver); isSingleResultSetMapping = query.canReturnScalarValue() && super.isSingleResultSetMapping(); return true; } return false; }
/** * Returns the fetchLimit. */ public int getFetchLimit() { return metaData.getFetchLimit(); }
/** * Returns a query built using this query as a prototype, using a set of * parameters to build the qualifier. * * @see org.apache.cayenne.exp.Expression#expWithParameters(java.util.Map, * boolean) parameter substitution. */ public SelectQuery<T> queryWithParameters(Map<String, ?> parameters, boolean pruneMissing) { // create a query replica SelectQuery<T> query = new SelectQuery<T>(); query.setDistinct(distinct); query.metaData.copyFromInfo(this.metaData); query.setRoot(root); if (orderings != null) { query.addOrderings(orderings); } // substitute qualifier parameters if (qualifier != null) { query.setQualifier(qualifier.params(parameters, pruneMissing)); } return query; }
metaData.encodeAsXML(encoder);
DbRelationship r = findRelationByPath(table, dbPrefetch); if (r == null) { throw new CayenneRuntimeException("Invalid joint prefetch '%s' for entity: %s"