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

📄 collectionsubqueryfactory.java

📁 介绍了hibernate的入门有一些基本常用的事例
💻 JAVA
字号:
// $Id: CollectionSubqueryFactory.java,v 1.3 2005/02/23 02:31:40 oneovthafew Exp $package org.hibernate.hql;import org.hibernate.engine.JoinSequence;import org.hibernate.sql.JoinFragment;import org.hibernate.MappingException;import org.hibernate.QueryException;import org.hibernate.util.StringHelper;import java.util.Map;/** * Provides the SQL for collection subqueries. * <br> * Moved here from PathExpressionParser to make it re-useable. * @author josh Dec 23, 2004 7:12:55 AM */public final class CollectionSubqueryFactory {	private CollectionSubqueryFactory() {	}	public static String createCollectionSubquery(JoinSequence joinSequence, Map enabledFilters, String[] columns) {		//TODO: refactor to .sql package		JoinFragment join;		try {			join = joinSequence.toJoinFragment( enabledFilters, true );		}		catch ( MappingException me ) {			throw new QueryException( me );		}		return new StringBuffer( "select " )				.append( StringHelper.join( ", ", columns ) )				.append( " from " )				/*.append(collectionTable)				.append(' ')				.append(collectionName)*/				.append( join.toFromFragmentString().substring( 2 ) )// remove initial ", "				.append( " where " )				.append( join.toWhereFragmentString().substring( 5 ) )// remove initial " and "				.toString();	}}

⌨️ 快捷键说明

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