DefaultModelQueryExecutor extends ModelExecutorBase implements ModelQueryExecutor { protected void expand(ModelExecutionContext context, ResolvedExpand expand, List<Record> records) { if (records == null || records.size() == 0) { return; } if (expand.isRemoteRest()) { expandByRest(context, expand, records); } else { expandByDb(context, expand, records); } } DefaultModelQueryExecutor(ModelExecutorContext context);  DefaultModelQueryExecutor(ModelExecutorContext context, ModelQueryExtension ex); @Override ModelQueryExecutor withFindHandler(FindHandler handler); @Override ModelQueryExecutor withListeners(EntityListeners listeners); @Override ModelQueryExecutor fromSqlView(String sql); @Override ModelQueryExecutor fromSqlView(String sql, Map<String, Object> params); @Override ModelQueryExecutor selectExclude(String... names); @Override ModelQueryExecutor setFilterByParams(boolean filterByParams); @Override QueryOneResult queryOne(Object id, QueryOptionsBase options); @Override QueryOneResult queryOneByKey(Map<String, Object> key, QueryOptionsBase options); @Override QueryListResult queryList(QueryOptions options, Map<String, Object> filters, Consumer<CriteriaQuery> callback); @Override QueryListResult queryList(QueryOptions options, Map<String, Object> filters, Consumer<CriteriaQuery> callback, boolean filterByParams); @Override QueryListResult count(CountOptions options, Consumer<CriteriaQuery> callback); void calcIdsByEmbeddedField(Set<Object> ids, Record record, String embeddedFieldName);  }
@Test public void testExpand() { DefaultModelQueryExecutor executor = newExecutor(Book.class); QueryOptions options = new QueryOptions(); options.setExpand("author"); List<Record> records = executor.queryList(options).list; assertNotNull(records.get(0).get("author")); QueryOptions options2 = new QueryOptions(); options2.setExpand("tags"); List<Record> records2 = executor.queryList(options2).list; assertNotNull(records2.get(0).get("tags")); }