Package org.springframework.batch.item.database.support

Examples of org.springframework.batch.item.database.support.HsqlPagingQueryProvider


    @Override
  protected ItemReader<Foo> createItemReader() throws Exception {

    JdbcPagingItemReader<Foo> inputSource = new JdbcPagingItemReader<Foo>();
    inputSource.setDataSource(dataSource);
    HsqlPagingQueryProvider queryProvider = new HsqlPagingQueryProvider();
    queryProvider.setSelectClause("select ID, NAME, VALUE");
    queryProvider.setFromClause("from T_FOOS");
    Map<String, Order> sortKeys = new LinkedHashMap<String, Order>();
    sortKeys.put("ID", Order.ASCENDING);
    queryProvider.setSortKeys(sortKeys);
    inputSource.setQueryProvider(queryProvider);
    inputSource.setRowMapper(
        new ParameterizedRowMapper<Foo>() {
                    @Override
          public Foo mapRow(ResultSet rs, int i) throws SQLException {
View Full Code Here


        }
        super.doJumpToPage(itemIndex);
      }
    };
    reader.setDataSource(dataSource);
    HsqlPagingQueryProvider queryProvider = new HsqlPagingQueryProvider();
    queryProvider.setSelectClause("select ID, NAME, VALUE");
    queryProvider.setFromClause("from T_FOOS");
    queryProvider.setWhereClause("where VALUE >= ?");
    Map<String, Order> sortKeys = new LinkedHashMap<String, Order>();
    sortKeys.put("ID", Order.ASCENDING);
    queryProvider.setSortKeys(sortKeys);
    reader.setParameterValues(Collections.<String, Object>singletonMap("limit", 2));
    reader.setQueryProvider(queryProvider);
    reader.setRowMapper(
        new ParameterizedRowMapper<Foo>() {
                    @Override
View Full Code Here

        }
        super.doJumpToPage(itemIndex);
      }
    };
    reader.setDataSource(dataSource);
    HsqlPagingQueryProvider queryProvider = new HsqlPagingQueryProvider();
    queryProvider.setSelectClause("select ID, NAME, VALUE");
    queryProvider.setFromClause("from T_FOOS");
    queryProvider.setWhereClause("where VALUE >= :limit");
    Map<String, Order> sortKeys = new LinkedHashMap<String, Order>();
    sortKeys.put("ID", Order.ASCENDING);
    queryProvider.setSortKeys(sortKeys);
    reader.setParameterValues(Collections.<String, Object>singletonMap("limit", 2));
    reader.setQueryProvider(queryProvider);
    reader.setRowMapper(
        new ParameterizedRowMapper<Foo>() {
                    @Override
View Full Code Here

  protected ItemReader<Foo> getItemReader() throws Exception {

    JdbcPagingItemReader<Foo> reader = new JdbcPagingItemReader<Foo>();
    reader.setDataSource(dataSource);
    HsqlPagingQueryProvider queryProvider = new HsqlPagingQueryProvider();
    queryProvider.setSelectClause("select ID, NAME, VALUE");
    queryProvider.setFromClause("from T_FOOS");
    Map<String, Order> sortKeys = new LinkedHashMap<String, Order>();
    sortKeys.put("ID", Order.ASCENDING);
    queryProvider.setSortKeys(sortKeys);
    reader.setQueryProvider(queryProvider);
    reader.setRowMapper(new ParameterizedRowMapper<Foo>() {
            @Override
      public Foo mapRow(ResultSet rs, int i) throws SQLException {
        Foo foo = new Foo();
View Full Code Here

    @Override
  protected ItemReader<Foo> createItemReader() throws Exception {

    JdbcPagingItemReader<Foo> inputSource = new JdbcPagingItemReader<Foo>();
    inputSource.setDataSource(dataSource);
    HsqlPagingQueryProvider queryProvider = new HsqlPagingQueryProvider();
    queryProvider.setSelectClause("select ID, NAME, VALUE");
    queryProvider.setFromClause("from T_FOOS");
    Map<String, Order> sortKeys = new LinkedHashMap<String, Order>();
    sortKeys.put("VALUE", Order.ASCENDING);
    sortKeys.put("NAME", Order.DESCENDING);
    queryProvider.setSortKeys(sortKeys);
    inputSource.setQueryProvider(queryProvider);
    inputSource.setRowMapper(
        new ParameterizedRowMapper<Foo>() {
                    @Override
          public Foo mapRow(ResultSet rs, int i) throws SQLException {
View Full Code Here

    @Override
  protected ItemReader<Foo> getItemReader() throws Exception {

    JdbcPagingItemReader<Foo> reader = new JdbcPagingItemReader<Foo>();
    reader.setDataSource(dataSource);
    HsqlPagingQueryProvider queryProvider = new HsqlPagingQueryProvider();
    queryProvider.setSelectClause("select ID, NAME, VALUE");
    queryProvider.setFromClause("from T_FOOS");
    Map<String, Order> sortKeys = new LinkedHashMap<String, Order>();
    sortKeys.put("ID", Order.ASCENDING);
    queryProvider.setSortKeys(sortKeys);
    reader.setQueryProvider(queryProvider);
    reader.setRowMapper(
        new ParameterizedRowMapper<Foo>() {
                    @Override
          public Foo mapRow(ResultSet rs, int i) throws SQLException {
View Full Code Here

    @Override
  protected void pointToEmptyInput(ItemReader<Foo> tested) throws Exception {
    JdbcPagingItemReader<Foo> reader = (JdbcPagingItemReader<Foo>) tested;
    reader.close();
    reader.setDataSource(dataSource);
    HsqlPagingQueryProvider queryProvider = new HsqlPagingQueryProvider();
    queryProvider.setSelectClause("select ID, NAME, VALUE");
    queryProvider.setFromClause("from T_FOOS");
    queryProvider.setWhereClause("where ID = -1");
    Map<String, Order> sortKeys = new LinkedHashMap<String, Order>();
    sortKeys.put("ID", Order.ASCENDING);
    queryProvider.setSortKeys(sortKeys);
    reader.setQueryProvider(queryProvider);
    reader.setPageSize(3);
    reader.afterPropertiesSet();
    reader.open(new ExecutionContext());
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.item.database.support.HsqlPagingQueryProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.