1 16 17 package org.springframework.dao; 18 19 27 public class IncorrectResultSizeDataAccessException extends DataRetrievalFailureException { 28 29 private int expectedSize; 30 31 private int actualSize; 32 33 34 38 public IncorrectResultSizeDataAccessException(int expectedSize) { 39 super("Incorrect result size: expected " + expectedSize); 40 this.expectedSize = expectedSize; 41 this.actualSize = -1; 42 } 43 44 49 public IncorrectResultSizeDataAccessException(int expectedSize, int actualSize) { 50 super("Incorrect result size: expected " + expectedSize + ", actual " + actualSize); 51 this.expectedSize = expectedSize; 52 this.actualSize = actualSize; 53 } 54 55 60 public IncorrectResultSizeDataAccessException(String msg, int expectedSize) { 61 super(msg); 62 this.expectedSize = expectedSize; 63 this.actualSize = -1; 64 } 65 66 72 public IncorrectResultSizeDataAccessException(String msg, int expectedSize, int actualSize) { 73 super(msg); 74 this.expectedSize = expectedSize; 75 this.actualSize = actualSize; 76 } 77 78 79 82 public int getExpectedSize() { 83 return expectedSize; 84 } 85 86 89 public int getActualSize() { 90 return actualSize; 91 } 92 93 } 94 | Popular Tags |