Package com.j256.ormlite.support

Examples of com.j256.ormlite.support.CompiledStatement.runUpdate()


    DatabaseConnection connection = createMock(DatabaseConnection.class);
    @SuppressWarnings("unchecked")
    PreparedDelete<Foo> delete = createMock(PreparedDelete.class);
    CompiledStatement compiledStmt = createMock(CompiledStatement.class);
    expect(delete.compile(connection, StatementType.DELETE)).andReturn(compiledStmt);
    expect(compiledStmt.runUpdate()).andThrow(new SQLException("expected"));
    compiledStmt.close();
    StatementExecutor<Foo, String> statementExec =
        new StatementExecutor<Foo, String>(databaseType, tableInfo, null);
    replay(connection, compiledStmt, delete);
    try {
View Full Code Here


    CompiledStatement compiledStatement =
        connection.compileStatement(statement, StatementType.UPDATE, noFieldTypes,
            DatabaseConnection.DEFAULT_RESULT_FLAGS);
    try {
      assignStatementArguments(compiledStatement, arguments);
      return compiledStatement.runUpdate();
    } finally {
      IOUtils.closeThrowSqlException(compiledStatement, "compiled statement");
    }
  }
View Full Code Here

   * Update rows in the database.
   */
  public int update(DatabaseConnection databaseConnection, PreparedUpdate<T> preparedUpdate) throws SQLException {
    CompiledStatement compiledStatement = preparedUpdate.compile(databaseConnection, StatementType.UPDATE);
    try {
      int result = compiledStatement.runUpdate();
      if (dao != null && !localIsInBatchMode.get()) {
        dao.notifyChanges();
      }
      return result;
    } finally {
View Full Code Here

   * Delete rows that match the prepared statement.
   */
  public int delete(DatabaseConnection databaseConnection, PreparedDelete<T> preparedDelete) throws SQLException {
    CompiledStatement compiledStatement = preparedDelete.compile(databaseConnection, StatementType.DELETE);
    try {
      int result = compiledStatement.runUpdate();
      if (dao != null && !localIsInBatchMode.get()) {
        dao.notifyChanges();
      }
      return result;
    } finally {
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.