propertyvalueexception.java

来自「用Java实现的23个常用设计模式源代码」· Java 代码 · 共 45 行

JAVA
45
字号
//$Id: PropertyValueException.java,v 1.1.2.1 2003/11/27 13:24:16 oneovthafew Exp $package net.sf.hibernate;import net.sf.hibernate.util.StringHelper;/** * Thrown when the (illegal) value of a property can not be persisted.  * There are two main causes: * <ul> * <li>a property declared <tt>not-null="true"</tt> is null * <li>an association references an unsaved transient instance * </ul> * @author Gavin King */public class PropertyValueException extends HibernateException {		private final Class persistentClass;	private final String propertyName;		public PropertyValueException(String s, Class persistentClass, String propertyName) {		super(s);		this.persistentClass = persistentClass;		this.propertyName = propertyName;	}		public Class getPersistentClass() {		return persistentClass;	}		public String getPropertyName() {		return propertyName;	}		public String getMessage() {		return super.getMessage() +		StringHelper.qualify( persistentClass.getName(), propertyName );	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?