private void processInitial() { if (parser.isMatch("find")) { OrmQueryProperties props = readFindFetch(); detail.setBase(props); } else { process(); } while (!parser.isFinished()) { process(); } }
/** * Return true if this path is a candidate for converting to a query join. */ private boolean isQueryJoinCandidate(String lazyLoadManyPath, OrmQueryProperties chunk) { return chunk.isFetchJoin() && !isLazyLoadManyRoot(lazyLoadManyPath, chunk) && !hasParentSecJoin(lazyLoadManyPath, chunk); }
@Override public SpiQuerySecondary convertJoins() { if (!useDocStore) { createExtraJoinsToSupportManyWhereClause(); } markQueryJoins(); return new OrmQuerySecondary(removeQueryJoins(), removeLazyJoins()); }
private void process() { if (isFetch()) { detail.fetch(readFindFetch()); } else { throw new PersistenceException("Query expected 'fetch', 'where','order by' or 'limit' keyword but got [" + parser.getWord() + "] \r " + parser.getOql()); } }
public void setFilterMany(String prop, ExpressionList<?> filterMany){ if (filterMany != null){ OrmQueryProperties chunk = detail.getChunk(prop, true); chunk.setFilterMany((SpiExpressionList<?>)filterMany); } }
public ExpressionList<T> filterMany(String prop){ OrmQueryProperties chunk = detail.getChunk(prop, true); return chunk.filterMany(this); }
public OrmQueryDetail parse() throws PersistenceException { if (parser.isEmpty()) return detail; parser.nextWord(); processInitial(); return detail; }
public void parse() throws PersistenceException { parser.nextWord(); processInitial(); }
/** * Add the explicit bean join. * <p> * This is also used to Exclude the matching property from the parent select * (aka remove the foreign key) because it is now included in it's on node * in the SqlTree. * </p> */ public void includeBeanJoin(String parentPath, String propertyName) { OrmQueryProperties parentChunk = getChunk(parentPath, true); parentChunk.includeBeanJoin(propertyName); }
/** * Set the fetch properties and configuration for a given path. * * @param path the property to join * @param partialProps the properties on the join property to include */ public void fetch(String path, String partialProps, FetchConfig fetchConfig) { fetch(new OrmQueryProperties(path, partialProps, fetchConfig)); }
/** * Limit the number of fetch joins to Many properties, mark as query joins as needed. */ private void markQueryJoins() { detail.markQueryJoins(beanDescriptor, lazyLoadManyPath, isAllowOneManyFetch()); }
private void processInitial() { if (parser.isMatch("find")) { OrmQueryProperties props = readFindFetch(); detail.setBase(props); } else { process(); } while (!parser.isFinished()) { process(); } }
public void setFilterMany(String prop, ExpressionList<?> filterMany){ if (filterMany != null){ OrmQueryProperties chunk = detail.getChunk(prop, true); chunk.setFilterMany((SpiExpressionList<?>)filterMany); } }
public ExpressionList<T> filterMany(String prop){ OrmQueryProperties chunk = detail.getChunk(prop, true); return chunk.filterMany(this); }
public void parse() throws PersistenceException { parser.nextWord(); processInitial(); }
/** * Add for raw sql etc when the properties are already parsed into a set. */ public void fetch(String path, LinkedHashSet<String> properties) { fetch(new OrmQueryProperties(path, properties)); }
@Override public void setFilterMany(String prop, ExpressionList<?> filterMany) { if (filterMany != null) { OrmQueryProperties chunk = detail.getChunk(prop, true); chunk.setFilterMany((SpiExpressionList<?>) filterMany); } }
@Override public ExpressionList<T> filterMany(String prop) { OrmQueryProperties chunk = detail.getChunk(prop, true); return chunk.filterMany(this); }