1 package org.hibernate; 3 4 import org.hibernate.util.StringHelper; 5 6 18 public class PropertyAccessException extends HibernateException { 19 20 private final Class persistentClass; 21 private final String propertyName; 22 private final boolean wasSetter; 23 24 public PropertyAccessException(Throwable root, String s, boolean wasSetter, Class persistentClass, String propertyName) { 25 super(s, root); 26 this.persistentClass = persistentClass; 27 this.wasSetter = wasSetter; 28 this.propertyName = propertyName; 29 } 30 31 public Class getPersistentClass() { 32 return persistentClass; 33 } 34 35 public String getPropertyName() { 36 return propertyName; 37 } 38 39 public String getMessage() { 40 return super.getMessage() + 41 ( wasSetter ? " setter of " : " getter of ") + 42 StringHelper.qualify( persistentClass.getName(), propertyName ); 43 } 44 } 45 46 47 48 49 50 51 | Popular Tags |