@Test public void testBasic() throws Exception { SearchResult result = dao.find(searchRequest); Assert.assertTrue(result != null); Assert.assertTrue(result.getResultData().length == 92); searchRequest.setStartRow(90L); result = dao.find(searchRequest); Assert.assertTrue(result != null); Assert.assertTrue(result.getResultData().length == 3); searchRequest.setStartRow(null); searchRequest.setMaxRows(10L); result = dao.find(searchRequest); Assert.assertTrue(result != null); Assert.assertTrue(result.getResultData().length == 10); }
public SearchResult find(SearchRequest request) { Validate.notNull(request, "Null search request not allowed."); Validate.notEmpty(request.getTopic(), "Null or blank search topic not allowed."); Topic searchTopic = MonetaEnvironment.getConfiguration().getTopic(request.getTopic()); Validate.notNull(searchTopic, "Search topic not found. topic="+request.getTopic()); MonetaDataSource source = MonetaEnvironment.getConfiguration().getMonetaDataSource(searchTopic.getDataSourceName()); SqlStatement sqlStmt = SqlGeneratorFactory.findSqlGenerator(source.getDialect()) .generateSelect(searchTopic, request.getSearchCriteria(), request.getFieldNames()); SqlSelectExecutor sExec = new SqlSelectExecutor(request.getTopic(), sqlStmt); sExec.setMaxRows(request.getMaxRows()); sExec.setStartRow(request.getStartRow()); return sExec.call(); }
MonetaSearchDAO extends BaseDAO { public SearchResult find(SearchRequest request) { Validate.notNull(request, "Null search request not allowed."); Validate.notEmpty(request.getTopic(), "Null or blank search topic not allowed."); Topic searchTopic = MonetaEnvironment.getConfiguration().getTopic(request.getTopic()); Validate.notNull(searchTopic, "Search topic not found. topic="+request.getTopic()); MonetaDataSource source = MonetaEnvironment.getConfiguration().getMonetaDataSource(searchTopic.getDataSourceName()); SqlStatement sqlStmt = SqlGeneratorFactory.findSqlGenerator(source.getDialect()) .generateSelect(searchTopic, request.getSearchCriteria(), request.getFieldNames()); SqlSelectExecutor sExec = new SqlSelectExecutor(request.getTopic(), sqlStmt); sExec.setMaxRows(request.getMaxRows()); sExec.setStartRow(request.getStartRow()); return sExec.call(); } }
MonetaSearchDAO extends BaseDAO { public SearchResult find(SearchRequest request) { Validate.notNull(request, "Null search request not allowed."); Validate.notEmpty(request.getTopic(), "Null or blank search topic not allowed."); Topic searchTopic = MonetaEnvironment.getConfiguration().getTopic(request.getTopic()); Validate.notNull(searchTopic, "Search topic not found. topic="+request.getTopic()); MonetaDataSource source = MonetaEnvironment.getConfiguration().getMonetaDataSource(searchTopic.getDataSourceName()); SqlStatement sqlStmt = SqlGeneratorFactory.findSqlGenerator(source.getDialect()) .generateSelect(searchTopic, request.getSearchCriteria(), request.getFieldNames()); SqlSelectExecutor sExec = new SqlSelectExecutor(request.getTopic(), sqlStmt); sExec.setMaxRows(request.getMaxRows()); sExec.setStartRow(request.getStartRow()); return sExec.call(); }  }
MonetaSearchDAO extends BaseDAO { public SearchResult find(SearchRequest request) { Validate.notNull(request, "Null search request not allowed."); Validate.notEmpty(request.getTopic(), "Null or blank search topic not allowed."); Topic searchTopic = MonetaEnvironment.getConfiguration().getTopic(request.getTopic()); Validate.notNull(searchTopic, "Search topic not found. topic="+request.getTopic()); MonetaDataSource source = MonetaEnvironment.getConfiguration().getMonetaDataSource(searchTopic.getDataSourceName()); SqlStatement sqlStmt = SqlGeneratorFactory.findSqlGenerator(source.getDialect()) .generateSelect(searchTopic, request.getSearchCriteria(), request.getFieldNames()); SqlSelectExecutor sExec = new SqlSelectExecutor(request.getTopic(), sqlStmt); sExec.setMaxRows(request.getMaxRows()); sExec.setStartRow(request.getStartRow()); return sExec.call(); }  SearchResult find(SearchRequest request); }
MonetaSearchDAO extends BaseDAO { public SearchResult find(SearchRequest request) { Validate.notNull(request, "Null search request not allowed."); Validate.notEmpty(request.getTopic(), "Null or blank search topic not allowed."); Topic searchTopic = MonetaEnvironment.getConfiguration().getTopic(request.getTopic()); Validate.notNull(searchTopic, "Search topic not found. topic="+request.getTopic()); MonetaDataSource source = MonetaEnvironment.getConfiguration().getMonetaDataSource(searchTopic.getDataSourceName()); SqlStatement sqlStmt = SqlGeneratorFactory.findSqlGenerator(source.getDialect()) .generateSelect(searchTopic, request.getSearchCriteria(), request.getFieldNames()); SqlSelectExecutor sExec = new SqlSelectExecutor(request.getTopic(), sqlStmt); sExec.setMaxRows(request.getMaxRows()); sExec.setStartRow(request.getStartRow()); return sExec.call(); }  SearchResult find(SearchRequest request);  }