/** * Return true if this is actually the root level of a +query/+lazy loading query. */ private boolean isLazyLoadManyRoot(String lazyLoadManyPath, OrmQueryProperties chunk) { return lazyLoadManyPath != null && lazyLoadManyPath.equals(chunk.getPath()); }
/** * Add or replace the fetch detail. */ protected void fetch(OrmQueryProperties chunk) { String path = chunk.getPath(); if (path == null) { baseProps = chunk; } else { fetchPaths.put(path, chunk); } }
/** * Return true if this is actually the root level of a +query/+lazy loading * query. */ private boolean isLazyLoadManyRoot(String lazyLoadManyPath, OrmQueryProperties chunk) { if (lazyLoadManyPath != null && lazyLoadManyPath.equals(chunk.getPath())) { return true; } return false; }
/** * Return true if this is actually the root level of a +query/+lazy loading * query. */ private boolean isLazyLoadManyRoot(String lazyLoadManyPath, OrmQueryProperties chunk) { if (lazyLoadManyPath != null && lazyLoadManyPath.equals(chunk.getPath())) { return true; } return false; }
public boolean isChild(OrmQueryProperties possibleChild) { return possibleChild.getPath().startsWith(path + "."); }
boolean isChild(OrmQueryProperties possibleChild) { return possibleChild.getPath().startsWith(path + "."); }
public boolean isChild(OrmQueryProperties possibleChild) { return possibleChild.getPath().startsWith(path + "."); }
/** * Matches a join() method of the query. */ public void putFetchPath(OrmQueryProperties chunk) { String path = chunk.getPath(); fetchPaths.put(path, chunk); includes.add(path); }
/** * Matches a join() method of the query. */ public void putFetchPath(OrmQueryProperties chunk) { String path = chunk.getPath(); fetchPaths.put(path, chunk); includes.add(path); }
private void registerSecondaryNode(boolean many, OrmQueryProperties props) { String path = props.getPath(); int lazyJoinBatch = props.getLazyFetchBatch(); int batchSize = lazyJoinBatch > 0 ? lazyJoinBatch : defaultBatchSize; if (many){ DLoadManyContext manyContext = createManyContext(path, batchSize, props); manyMap.put(path, manyContext); } else { DLoadBeanContext beanContext = createBeanContext(path, batchSize, props); beanMap.put(path, beanContext); } }
/** * Execute all the secondary queries. */ public void executeSecondaryQueries(OrmQueryRequest<?> parentRequest, boolean forEach) { if (secQuery != null) { for (OrmQueryProperties aSecQuery : secQuery) { LoadSecondaryQuery load = getLoadSecondaryQuery(aSecQuery.getPath()); load.loadSecondaryQuery(parentRequest, forEach); } } }
private void registerSecondaryNode(boolean many, OrmQueryProperties props) { String path = props.getPath(); int lazyJoinBatch = props.getLazyFetchBatch(); int batchSize = lazyJoinBatch > 0 ? lazyJoinBatch : defaultBatchSize; if (many){ DLoadManyContext manyContext = createManyContext(path, batchSize, props); manyMap.put(path, manyContext); } else { DLoadBeanContext beanContext = createBeanContext(path, batchSize, props); beanMap.put(path, beanContext); } }
/** * If the chunk has a parent that is a query or lazy join. In this case it does not need to be * converted. */ private boolean hasParentSecJoin(String lazyLoadManyPath, OrmQueryProperties chunk) { OrmQueryProperties parent = getParent(chunk); if (parent == null) { return false; } else { if (lazyLoadManyPath != null && lazyLoadManyPath.equals(parent.getPath())) { return false; } else { return !parent.isFetchJoin() || hasParentSecJoin(lazyLoadManyPath, parent); } } }
private void registerSecondaryNode(boolean many, OrmQueryProperties props) { int batchSize; if (props.isQueryFetch()) { batchSize = 100; } else { int lazyJoinBatch = props.getLazyFetchBatch(); batchSize = lazyJoinBatch > 0 ? lazyJoinBatch : defaultBatchSize; } String path = props.getPath(); if (many) { manyMap.put(path, createManyContext(path, batchSize, props)); } else { beanMap.put(path, createBeanContext(path, batchSize, props)); } }
/** * If the chunk has a parent that is a query or lazy join. In this case it * does not need to be converted. */ private boolean hasParentSecJoin(String lazyLoadManyPath, OrmQueryProperties chunk) { OrmQueryProperties parent = getParent(chunk); if (parent == null) { return false; } else { if (lazyLoadManyPath != null && lazyLoadManyPath.equals(parent.getPath())) { return false; } else if (!parent.isFetchJoin()) { return true; } else { return hasParentSecJoin(lazyLoadManyPath, parent); } } }
/** * Execute all the secondary queries. */ public void executeSecondaryQueries(OrmQueryRequest<?> parentRequest, int defaultQueryBatch) { if (secQuery != null){ for (int i = 0; i < secQuery.size(); i++) { OrmQueryProperties properties = secQuery.get(i); int batchSize = properties.getQueryFetchBatch(); if (batchSize == 0){ batchSize = defaultQueryBatch; } LoadSecondaryQuery load = getLoadSecondaryQuery(properties.getPath()); load.loadSecondaryQuery(parentRequest, batchSize, properties.isQueryFetchAll()); } } }
/** * Execute all the secondary queries. */ public void executeSecondaryQueries(OrmQueryRequest<?> parentRequest, int defaultQueryBatch) { if (secQuery != null){ for (int i = 0; i < secQuery.size(); i++) { OrmQueryProperties properties = secQuery.get(i); int batchSize = properties.getQueryFetchBatch(); if (batchSize == 0){ batchSize = defaultQueryBatch; } LoadSecondaryQuery load = getLoadSecondaryQuery(properties.getPath()); load.loadSecondaryQuery(parentRequest, batchSize, properties.isQueryFetchAll()); } } }
/** * Setup the load context at this path with OrmQueryProperties which is * used to build the appropriate query for +query or +lazy loading. */ private void registerSecondaryQuery(OrmQueryProperties props) { ElPropertyValue elGetValue = rootDescriptor.getElGetValue(props.getPath()); boolean many = elGetValue.getBeanProperty().containsMany(); registerSecondaryNode(many, props); }
/** * Setup the load context at this path with OrmQueryProperties which is * used to build the appropriate query for +query or +lazy loading. */ private void registerSecondaryQuery(OrmQueryProperties props) { String propName = props.getPath(); ElPropertyValue elGetValue = rootDescriptor.getElGetValue(propName); boolean many = elGetValue.getBeanProperty().containsMany(); registerSecondaryNode(many, props); }
/** * Setup the load context at this path with OrmQueryProperties which is * used to build the appropriate query for +query or +lazy loading. */ private void registerSecondaryQuery(OrmQueryProperties props) { String propName = props.getPath(); ElPropertyValue elGetValue = rootDescriptor.getElGetValue(propName); boolean many = elGetValue.getBeanProperty().containsMany(); registerSecondaryNode(many, props); }