propertyvalueexception.java

来自「hibernate 开源框架的代码 jar包希望大家能喜欢」· Java 代码 · 共 57 行

JAVA
57
字号
//$Id: PropertyValueException.java 5685 2005-02-12 07:19:50Z steveebersole $package org.hibernate;import org.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 String entityName;	private final String propertyName;	public PropertyValueException(String s, String entityName, String propertyName) {		super(s);		this.entityName = entityName;		this.propertyName = propertyName;	}	public String getEntityName() {		return entityName;	}	public String getPropertyName() {		return propertyName;	}	public String getMessage() {		return super.getMessage() + ": " +			StringHelper.qualify(entityName, propertyName);	}	/**	 * Return a well formed property path.	 * Basicaly, it will return parent.child	 *	 * @param parent parent in path	 * @param child child in path	 * @return parent-child path	 */	public static String buildPropertyPath(String parent, String child) {		return new StringBuffer(parent).append('.').append(child).toString();	}}

⌨️ 快捷键说明

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