01: /*
02: * Copyright 2002-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springframework.dao;
18:
19: import org.springframework.core.NestedRuntimeException;
20:
21: /**
22: * Root of the hierarchy of data access exceptions discussed in
23: * <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/">Expert One-On-One J2EE Design and Development</a>.
24: * Please see Chapter 9 of this book for detailed discussion of the
25: * motivation for this package.
26: *
27: * <p>This exception hierarchy aims to let user code find and handle the
28: * kind of error encountered without knowing the details of the particular
29: * data access API in use (e.g. JDBC). Thus it is possible to react to an
30: * optimistic locking failure without knowing that JDBC is being used.
31: *
32: * <p>As this class is a runtime exception, there is no need for user code
33: * to catch it or subclasses if any error is to be considered fatal
34: * (the usual case).
35: *
36: * @author Rod Johnson
37: */
38: public abstract class DataAccessException extends
39: NestedRuntimeException {
40:
41: /**
42: * Constructor for DataAccessException.
43: * @param msg the detail message
44: */
45: public DataAccessException(String msg) {
46: super (msg);
47: }
48:
49: /**
50: * Constructor for DataAccessException.
51: * @param msg the detail message
52: * @param cause the root cause (usually from using a underlying
53: * data access API such as JDBC)
54: */
55: public DataAccessException(String msg, Throwable cause) {
56: super(msg, cause);
57: }
58:
59: }
|