Package org.springframework.jdbc.object

Examples of org.springframework.jdbc.object.SqlFunction


      return null;
    }
  }

  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


* @author Thierry Templier
*/
public class DocumentIdDaoImpl extends JdbcDaoSupport implements DocumentIdDao {

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

    sqlFunction.compile();
    return sqlFunction.run();
  }

  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

Related Classes of org.springframework.jdbc.object.SqlFunction

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.