org.springframework.jdbc
Class JdbcUpdateAffectedIncorrectNumberOfRowsException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byorg.springframework.core.NestedRuntimeException
                  extended byorg.springframework.dao.DataAccessException
                      extended byorg.springframework.dao.InvalidDataAccessResourceUsageException
                          extended byorg.springframework.dao.IncorrectUpdateSemanticsDataAccessException
                              extended byorg.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException
All Implemented Interfaces:
java.io.Serializable

public class JdbcUpdateAffectedIncorrectNumberOfRowsException
extends IncorrectUpdateSemanticsDataAccessException

Exception thrown when a JDBC update affects an unexpected number of rows. Typically we expect an update to affect a single row, meaning it's an error if it affects multiple rows.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
JdbcUpdateAffectedIncorrectNumberOfRowsException(java.lang.String sql, int expected, int actual)
           
 
Method Summary
 int getActualRowsAffected()
           
 boolean getDataWasUpdated()
          Return whether data was updated.
 int getExpectedRowsAffected()
           
 
Methods inherited from class org.springframework.core.NestedRuntimeException
getCause, getMessage, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JdbcUpdateAffectedIncorrectNumberOfRowsException

public JdbcUpdateAffectedIncorrectNumberOfRowsException(java.lang.String sql,
                                                        int expected,
                                                        int actual)
Method Detail

getExpectedRowsAffected

public int getExpectedRowsAffected()

getActualRowsAffected

public int getActualRowsAffected()

getDataWasUpdated

public boolean getDataWasUpdated()
Description copied from class: IncorrectUpdateSemanticsDataAccessException
Return whether data was updated.

Specified by:
getDataWasUpdated in class IncorrectUpdateSemanticsDataAccessException
Returns:
whether data was updated (as opposed to being incorrectly updated). If this method returns true, there's nothing to roll back.


Copyright (C) 2003-2004 The Spring Framework Project.