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: UnsupportedManyToManyValueTypeException.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 UnsupportedManyToManyValueTypeException extends
13: DatabaseException {
14: private Class mBeanClass;
15: private String mPropertyName;
16: private Object mValue;
17:
18: static final long serialVersionUID = 3522938795172371405L;
19:
20: public UnsupportedManyToManyValueTypeException(Class beanClass,
21: String propertyName, Object value) {
22: super (
23: "The bean '"
24: + beanClass.getName()
25: + "' declares a many-to-many relationship on property '"
26: + propertyName
27: + "', however the property's value type '"
28: + value.getClass().getName()
29: + "' is not supported. Only classes that implement the interfaces java.util.Collection can be used.");
30:
31: mBeanClass = beanClass;
32: mPropertyName = propertyName;
33: mValue = value;
34: }
35:
36: public Class getBeanClass() {
37: return mBeanClass;
38: }
39:
40: public String getPropertyName() {
41: return mPropertyName;
42: }
43:
44: public Object getValue() {
45: return mValue;
46: }
47: }
|