当前位置: 首页>>代码示例>>Java>>正文


Java Dialect.closeQuote方法代码示例

本文整理汇总了Java中org.hibernate.dialect.Dialect.closeQuote方法的典型用法代码示例。如果您正苦于以下问题:Java Dialect.closeQuote方法的具体用法?Java Dialect.closeQuote怎么用?Java Dialect.closeQuote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.dialect.Dialect的用法示例。


在下文中一共展示了Dialect.closeQuote方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getQuotedName

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
public String getQuotedName(Dialect dialect) {
	return quoted ?
			dialect.openQuote() + name + dialect.closeQuote() :
			name;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:Table.java

示例2: getQuotedSchema

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
public String getQuotedSchema(Dialect dialect) {
	return schemaQuoted ?
			dialect.openQuote() + schema + dialect.closeQuote() :
			schema;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:Table.java

示例3: getQuotedCatalog

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
public String getQuotedCatalog(Dialect dialect) {
	return catalogQuoted ?
			dialect.openQuote() + catalog + dialect.closeQuote() :
			catalog;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:Table.java

示例4: getQuotedName

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
public String getQuotedName(Dialect d) {
	return quoted ?
		d.openQuote() + name + d.closeQuote() :
		name;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:Column.java

示例5: processFilters

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
@SuppressWarnings( {"unchecked"})
public void processFilters(String sql, Map filters, SessionFactoryImplementor factory) {
	if ( filters.size() == 0 || !sql.contains( ParserHelper.HQL_VARIABLE_PREFIX ) ) {
		// HELLA IMPORTANT OPTIMIZATION!!!
		processedPositionalParameterValues = getPositionalParameterValues();
		processedPositionalParameterTypes = getPositionalParameterTypes();
		processedSQL = sql;
	}
	else {
		final Dialect dialect = factory.getDialect();
		final String symbols = ParserHelper.HQL_SEPARATORS + dialect.openQuote() + dialect.closeQuote();
		final StringTokenizer tokens = new StringTokenizer( sql, symbols, true );

		StringBuilder result = new StringBuilder();
		List parameters = new ArrayList();
		List parameterTypes = new ArrayList();

		int positionalIndex = 0;
		while ( tokens.hasMoreTokens() ) {
			final String token = tokens.nextToken();
			if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) {
				final String filterParameterName = token.substring( 1 );
				final String[] parts = LoadQueryInfluencers.parseFilterParameterName( filterParameterName );
				final FilterImpl filter = (FilterImpl) filters.get( parts[0] );
				final Object value = filter.getParameter( parts[1] );
				final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
				if ( value != null && Collection.class.isAssignableFrom( value.getClass() ) ) {
					Iterator itr = ( (Collection) value ).iterator();
					while ( itr.hasNext() ) {
						final Object elementValue = itr.next();
						result.append( '?' );
						parameters.add( elementValue );
						parameterTypes.add( type );
						if ( itr.hasNext() ) {
							result.append( ", " );
						}
					}
				}
				else {
					result.append( '?' );
					parameters.add( value );
					parameterTypes.add( type );
				}
			}
			else {
				if ( "?".equals( token ) && positionalIndex < getPositionalParameterValues().length ) {
					parameters.add( getPositionalParameterValues()[positionalIndex] );
					parameterTypes.add( getPositionalParameterTypes()[positionalIndex] );
					positionalIndex++;
				}
				result.append( token );
			}
		}
		processedPositionalParameterValues = parameters.toArray();
		processedPositionalParameterTypes = ( Type[] ) parameterTypes.toArray( new Type[parameterTypes.size()] );
		processedSQL = result.toString();
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:59,代码来源:QueryParameters.java

示例6: processDynamicFilterParameters

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
public static void processDynamicFilterParameters(
		final String sqlFragment,
		final ParameterContainer container,
		final HqlSqlWalker walker) {
	if ( walker.getEnabledFilters().isEmpty()
			&& ( !hasDynamicFilterParam( sqlFragment ) )
			&& ( !( hasCollectionFilterParam( sqlFragment ) ) ) ) {
		return;
	}

	Dialect dialect = walker.getSessionFactoryHelper().getFactory().getDialect();
	String symbols = ParserHelper.HQL_SEPARATORS + dialect.openQuote() + dialect.closeQuote();
	StringTokenizer tokens = new StringTokenizer( sqlFragment, symbols, true );
	StringBuilder result = new StringBuilder();

	while ( tokens.hasMoreTokens() ) {
		final String token = tokens.nextToken();
		if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) {
			final String filterParameterName = token.substring( 1 );
			final String[] parts = LoadQueryInfluencers.parseFilterParameterName( filterParameterName );
			final FilterImpl filter = (FilterImpl) walker.getEnabledFilters().get( parts[0] );
			final Object value = filter.getParameter( parts[1] );
			final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
			final String typeBindFragment = StringHelper.join(
					",",
					ArrayHelper.fillArray(
							"?",
							type.getColumnSpan( walker.getSessionFactoryHelper().getFactory() )
					)
			);
			final String bindFragment;
			if ( value != null && Collection.class.isInstance( value ) ) {
				bindFragment = StringHelper.join(
						",",
						ArrayHelper.fillArray( typeBindFragment, ( (Collection) value ).size() )
				);
			}
			else {
				bindFragment = typeBindFragment;
			}
			result.append( bindFragment );
			container.addEmbeddedParameter( new DynamicFilterParameterSpecification( parts[0], parts[1], type ) );
		}
		else {
			result.append( token );
		}
	}

	container.setText( result.toString() );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:51,代码来源:JoinProcessor.java

示例7: isQuoted

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
/**
 * Determine if the given name is quoted.  It is considered quoted if either:
 * <ol>
 * <li>starts AND ends with backticks (`)</li>
 * <li>starts with dialect-specified {@link org.hibernate.dialect.Dialect#openQuote() open-quote}
 * 		AND ends with dialect-specified {@link org.hibernate.dialect.Dialect#closeQuote() close-quote}</li>
 * </ol>
 *
 * @param name The name to check
 * @param dialect The dialect (to determine the "real" quoting chars).
 *
 * @return True if quoted, false otherwise
 */
public static boolean isQuoted(String name, Dialect dialect) {
	return name != null && name.length() != 0 
			&& ( ( name.charAt( 0 ) == '`' && name.charAt( name.length() - 1 ) == '`' )
					|| ( name.charAt( 0 ) == '"' && name.charAt( name.length() - 1 ) == '"' )
					|| ( name.charAt( 0 ) == dialect.openQuote()
							&& name.charAt( name.length() - 1 ) == dialect.closeQuote() ) );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:StringHelper.java


注:本文中的org.hibernate.dialect.Dialect.closeQuote方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。