⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 any.java

📁 JSP+SQL编写的人力资源管理系统
💻 JAVA
字号:
//$Id: Any.java,v 1.3.2.1 2003/11/06 13:43:22 oneovthafew Exp $
package net.sf.hibernate.mapping;

import net.sf.hibernate.Hibernate;
import net.sf.hibernate.type.ObjectType;
import net.sf.hibernate.type.Type;

/**
 * A Hibernate "any" type (ie. polymorphic association to 
 * one-of-several tables).
 * @author Gavin King
 */
public class Any extends SimpleValue {
	
	private Type identifierType;
	private Type metaType = Hibernate.CLASS;

	public Any(Table table) {
		super(table);
	}

	/**
	 * Returns the identifier type.
	 */
	public Type getIdentifierType() {
		return identifierType;
	}

	/**
	 * Sets the identifier type.
	 */
	public void setIdentifierType(Type identifierType) {
		this.identifierType = identifierType;
	}
	
	public Type getType() {
		return new ObjectType(metaType, identifierType);
	}
	
	public void setType(Type type) {
		throw new UnsupportedOperationException("cannot set type of an Any");
	}
	
	public void setTypeByReflection(Class propertyClass, String propertyName) {}

	public Type getMetaType() {
		return metaType;
	}

	public void setMetaType(Type type) {
		metaType = type;
	}

}

⌨️ 快捷键说明

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