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: IncompatibleManyToOneValueTypeException.java 3657 2007-02-15 23:39:06Z gbevin $
07: */
08: package com.uwyn.rife.database.querymanagers.generic.exceptions;
09:
10: import com.uwyn.rife.database.exceptions.DatabaseException;
11:
12: public class IncompatibleManyToOneValueTypeException extends
13: DatabaseException {
14: static final long serialVersionUID = -7028083340881018568L;
15:
16: private Class mBeanClass;
17: private String mPropertyName;
18: private Class mPropertyType;
19: private Class mAssociatedType;
20:
21: public IncompatibleManyToOneValueTypeException(Class beanClass,
22: String propertyName, Class propertyType,
23: Class associatedType) {
24: super ("The bean '" + beanClass.getName()
25: + "' declares a many-to-one relationship on property '"
26: + propertyName + "', however the property's type '"
27: + propertyType.getName()
28: + "' is not assignable from the associated class '"
29: + associatedType.getName()
30: + "' that has been declared through constraints.");
31:
32: mBeanClass = beanClass;
33: mPropertyName = propertyName;
34: mPropertyType = propertyType;
35: mAssociatedType = associatedType;
36: }
37:
38: public Class getBeanClass() {
39: return mBeanClass;
40: }
41:
42: public String getPropertyName() {
43: return mPropertyName;
44: }
45:
46: public Class getPropertyType() {
47: return mPropertyType;
48: }
49:
50: public Class getAssociatedType() {
51: return mAssociatedType;
52: }
53: }
|