Class IncorrectResultSizeDataAccessException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EmptyResultDataAccessException

public class IncorrectResultSizeDataAccessException extends DataRetrievalFailureException
Data access exception thrown when a result was not of the expected size, for example when expecting a single row but getting 0 or more than 1 rows.
Since:
1.0.2
Author:
Juergen Hoeller, Chris Beams
See Also:
  • Constructor Details

    • IncorrectResultSizeDataAccessException

      public IncorrectResultSizeDataAccessException(int expectedSize)
      Constructor for IncorrectResultSizeDataAccessException.
      Parameters:
      expectedSize - the expected result size
    • IncorrectResultSizeDataAccessException

      public IncorrectResultSizeDataAccessException(int expectedSize, int actualSize)
      Constructor for IncorrectResultSizeDataAccessException.
      Parameters:
      expectedSize - the expected result size
      actualSize - the actual result size (or -1 if unknown)
    • IncorrectResultSizeDataAccessException

      public IncorrectResultSizeDataAccessException(String msg, int expectedSize)
      Constructor for IncorrectResultSizeDataAccessException.
      Parameters:
      msg - the detail message
      expectedSize - the expected result size
    • IncorrectResultSizeDataAccessException

      public IncorrectResultSizeDataAccessException(@Nullable String msg, int expectedSize, @Nullable Throwable ex)
      Constructor for IncorrectResultSizeDataAccessException.
      Parameters:
      msg - the detail message
      expectedSize - the expected result size
      ex - the wrapped exception
    • IncorrectResultSizeDataAccessException

      public IncorrectResultSizeDataAccessException(@Nullable String msg, int expectedSize, int actualSize)
      Constructor for IncorrectResultSizeDataAccessException.
      Parameters:
      msg - the detail message
      expectedSize - the expected result size
      actualSize - the actual result size (or -1 if unknown)
    • IncorrectResultSizeDataAccessException

      public IncorrectResultSizeDataAccessException(@Nullable String msg, int expectedSize, int actualSize, @Nullable Throwable ex)
      Constructor for IncorrectResultSizeDataAccessException.
      Parameters:
      msg - the detail message
      expectedSize - the expected result size
      actualSize - the actual result size (or -1 if unknown)
      ex - the wrapped exception
  • Method Details

    • getExpectedSize

      public int getExpectedSize()
      Return the expected result size.
    • getActualSize

      public int getActualSize()
      Return the actual result size (or -1 if unknown).