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

📄 indexedcollection.java

📁 人力资源管理系统主要包括:人员管理、招聘管理、培训管理、奖惩管理和薪金管理五大管理模块。
💻 JAVA
字号:
//$Id: IndexedCollection.java,v 1.6.2.7 2003/12/17 03:56:43 oneovthafew Exp $package net.sf.hibernate.mapping;import net.sf.hibernate.MappingException;import net.sf.hibernate.engine.Mapping;/** * Indexed collections include Lists, Maps, arrays and * primitive arrays. * @author Gavin King */public abstract class IndexedCollection extends Collection {		public static final String DEFAULT_INDEX_COLUMN_NAME = "idx";		private SimpleValue index;		/**	 * Constructor for IndexedCollection.	 * @param owner	 */	public IndexedCollection(PersistentClass owner) {		super(owner);	}	public SimpleValue getIndex() {		return index;	}	public void setIndex(SimpleValue index) {		this.index = index;	}	public final boolean isIndexed() {		return true;	}	void createPrimaryKey() {		if ( !isOneToMany() ) {			PrimaryKey pk = new PrimaryKey();			pk.addColumns( getKey().getColumnIterator() );			pk.addColumns( getIndex().getColumnIterator() ); // index should be last column listed			getCollectionTable().setPrimaryKey(pk);		}		else {			// don't create a unique key, 'cos some			// databases don't like a UK on nullable			// columns			/*ArrayList list = new ArrayList();			list.addAll( getKey().getConstraintColumns() );			list.addAll( getIndex().getConstraintColumns() );			getCollectionTable().createUniqueKey(list);*/		}	}		public void validate(Mapping mapping) throws MappingException {		super.validate(mapping);		if ( !getIndex().isValid(mapping) ) {			throw new MappingException( 				"collection index mapping has wrong number of columns: " + 				getRole() +				" type: " + 				getIndex().getType().getName()			);		}	}}

⌨️ 快捷键说明

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