Package org.springframework.jdbc

Examples of org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException


    @Override
    public void update(String statementName, Object parameterObject, int requiredRowsAffected)
            throws DataAccessException {
        int rowAffected = this.update(statementName, parameterObject);
        if (rowAffected != requiredRowsAffected) {
            throw new JdbcUpdateAffectedIncorrectNumberOfRowsException(statementName,
                    requiredRowsAffected, rowAffected);
        }
    }
View Full Code Here


            getSqlMapClientTemplate().delete("com.alibaba.cobar.client.entities.Follower.deleteByName",
                    f, 2);
            fail("only one row will be affected in fact.");
        } catch (DataAccessException e) {
            assertTrue(e instanceof JdbcUpdateAffectedIncorrectNumberOfRowsException);
            JdbcUpdateAffectedIncorrectNumberOfRowsException ex = (JdbcUpdateAffectedIncorrectNumberOfRowsException) e;
            assertEquals(1, ex.getActualRowsAffected());
        }
        // although JdbcUpdateAffectedIncorrectNumberOfRowsException is raised, but the delete does performed successfully.
        verifyEntityNonExistenceOnSpecificDataSource(confirmSQL, jt1m);
        verifyEntityNonExistenceOnSpecificDataSource(confirmSQL, jt1s);
        verifyEntityNonExistenceOnSpecificDataSource(confirmSQL, jt2m);
View Full Code Here

             getSqlMapClientTemplate().delete("com.alibaba.cobar.client.entities.Follower.deleteByName",
                    f, 2);
            fail("only one row will be affected in fact.");
        } catch (DataAccessException e) {
            assertTrue(e instanceof JdbcUpdateAffectedIncorrectNumberOfRowsException);
            JdbcUpdateAffectedIncorrectNumberOfRowsException ex = (JdbcUpdateAffectedIncorrectNumberOfRowsException) e;
            assertEquals(1, ex.getActualRowsAffected());
        }
        // although JdbcUpdateAffectedIncorrectNumberOfRowsException is raised, but the delete does performed successfully.
        verifyEntityNonExistenceOnSpecificDataSource(confirmSQL, jt1m);
        verifyEntityNonExistenceOnSpecificDataSource(confirmSQL, jt1s);
        verifyEntityNonExistenceOnSpecificDataSource(confirmSQL, jt2m);
View Full Code Here

  public void update(String statementName, Object parameterObject, int requiredRowsAffected)
      throws DataAccessException {

    int actualRowsAffected = update(statementName, parameterObject);
    if (actualRowsAffected != requiredRowsAffected) {
      throw new JdbcUpdateAffectedIncorrectNumberOfRowsException(
          statementName, requiredRowsAffected, actualRowsAffected);
    }
  }
View Full Code Here

  public void delete(String statementName, Object parameterObject, int requiredRowsAffected)
      throws DataAccessException {

    int actualRowsAffected = delete(statementName, parameterObject);
    if (actualRowsAffected != requiredRowsAffected) {
      throw new JdbcUpdateAffectedIncorrectNumberOfRowsException(
          statementName, requiredRowsAffected, actualRowsAffected);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException

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.