Package org.springframework.jdbc.object

Examples of org.springframework.jdbc.object.SqlFunction.run()


  public void addCategory(DocumentCategory category) {
    SqlFunction sqlFunction = new SqlFunction(getDataSource(),
                  "select category_id from category");
    sqlFunction.compile();
    int categoryId = sqlFunction.run()+1;
    category.setId(categoryId);

    getJdbcTemplate().update(
      "insert into category (category_id,category_name) values(?,?)",
      new Object[] {new Integer(category.getId()), category.getName()},
View Full Code Here


  public long getNextDocumentId() {
    SqlFunction sqlFunction = new SqlFunction(getDataSource(),
                  "select next_document_id from document_id");
    sqlFunction.compile();
    return sqlFunction.run();
  }

  public void incrementDocumentId() {
    SqlFunction sqlFunction = new SqlFunction(getDataSource(),
                  "select next_document_id from document_id");
View Full Code Here

  public void incrementDocumentId() {
    SqlFunction sqlFunction = new SqlFunction(getDataSource(),
                  "select next_document_id from document_id");
    sqlFunction.compile();
    int nextDocumentId = sqlFunction.run();
    getJdbcTemplate().update("update document_id set next_document_id=?",
                  new Object[] { new Integer(nextDocumentId+1) });
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.