1 package org.hibernate; 3 4 import org.hibernate.util.StringHelper; 5 6 15 public class PropertyValueException extends HibernateException { 16 17 private final String entityName; 18 private final String propertyName; 19 20 public PropertyValueException(String s, String entityName, String propertyName) { 21 super(s); 22 this.entityName = entityName; 23 this.propertyName = propertyName; 24 } 25 26 public String getEntityName() { 27 return entityName; 28 } 29 30 public String getPropertyName() { 31 return propertyName; 32 } 33 34 public String getMessage() { 35 return super.getMessage() + ": " + 36 StringHelper.qualify(entityName, propertyName); 37 } 38 39 47 public static String buildPropertyPath(String parent, String child) { 48 return new StringBuffer (parent).append('.').append(child).toString(); 49 } 50 } 51 52 53 54 55 56 57 | Popular Tags |