當前位置: 首頁>>代碼示例>>Java>>正文


Java Dialect.openQuote方法代碼示例

本文整理匯總了Java中org.hibernate.dialect.Dialect.openQuote方法的典型用法代碼示例。如果您正苦於以下問題:Java Dialect.openQuote方法的具體用法?Java Dialect.openQuote怎麽用?Java Dialect.openQuote使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.hibernate.dialect.Dialect的用法示例。


在下文中一共展示了Dialect.openQuote方法的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.openQuote方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。