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: UnsupportedManyToOneValueTypeException.java 3725 2007-04-30 15:09:56Z gbevin $
07: */
08: package com.uwyn.rife.database.querymanagers.generic.exceptions;
09:
10: import com.uwyn.rife.database.exceptions.DatabaseException;
11:
12: public class UnsupportedManyToOneValueTypeException extends
13: DatabaseException {
14: private Class mBeanClass;
15: private String mPropertyName;
16: private Object mValue;
17:
18: public UnsupportedManyToOneValueTypeException(Class beanClass,
19: String propertyName, Object value) {
20: super (
21: "The bean '"
22: + beanClass.getName()
23: + "' declares a many-to-one relationship on property '"
24: + propertyName
25: + "', however the property's value type '"
26: + value.getClass().getName()
27: + "' is not supported. Only classes that implement the interfaces java.util.Collection can be used.");
28:
29: mBeanClass = beanClass;
30: mPropertyName = propertyName;
31: mValue = value;
32: }
33:
34: public Class getBeanClass() {
35: return mBeanClass;
36: }
37:
38: public String getPropertyName() {
39: return mPropertyName;
40: }
41:
42: public Object getValue() {
43: return mValue;
44: }
45: }
|