01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: IncompatibleValidationTypeException.java 3735 2007-05-04 23:08:07Z gbevin $
07: */
08: package com.uwyn.rife.database.querymanagers.generic.exceptions;
09:
10: import com.uwyn.rife.database.exceptions.DatabaseException;
11:
12: public class IncompatibleValidationTypeException extends
13: DatabaseException {
14: static final long serialVersionUID = -3877438782725574316L;
15:
16: private Class mIncompatibleType;
17: private Class mExpectedType;
18:
19: public IncompatibleValidationTypeException(Class incompatibleType,
20: Class expectedType) {
21: super (
22: "Trying to validate a bean of class '"
23: + incompatibleType.getName()
24: + "' while this GenericQueryManager only supports beans of the '"
25: + expectedType.getName() + "' class.");
26:
27: mIncompatibleType = incompatibleType;
28: mExpectedType = expectedType;
29: }
30:
31: public Class getExpectedType() {
32: return mExpectedType;
33: }
34:
35: public Class getIncompatibleType() {
36: return mIncompatibleType;
37: }
38: }
|