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


Java StringHelper.qualify方法代码示例

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


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

示例1: validate

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public void validate(Mapping mapping) throws MappingException {
	Iterator iter = getPropertyIterator();
	while ( iter.hasNext() ) {
		Property prop = (Property) iter.next();
		if ( !prop.isValid(mapping) ) {
			throw new MappingException(
					"property mapping has wrong number of columns: " +
					StringHelper.qualify( getEntityName(), prop.getName() ) +
					" type: " +
					prop.getType().getName()
				);
		}
	}
	checkPropertyDuplication();
	checkColumnDuplication();
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:17,代码来源:PersistentClass.java

示例2: createJoin

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
protected JoinFragment createJoin(String name, boolean innerJoin, boolean includeSubclasses) {
	final String[] idCols = StringHelper.qualify( name, getIdentifierColumnNames() ); //all joins join to the pk of the driving table
	final JoinFragment join = getFactory().getDialect().createOuterJoinFragment();
	final int tableSpan = getSubclassTableSpan();
	for ( int j = 1; j < tableSpan; j++ ) { //notice that we skip the first table; it is the driving table!
		final boolean joinIsIncluded = isClassOrSuperclassTable( j ) ||
				( includeSubclasses && !isSubclassTableSequentialSelect( j ) && !isSubclassTableLazy( j ) );
		if ( joinIsIncluded ) {
			join.addJoin( getSubclassTableName( j ),
					generateTableAlias( name, j ),
					idCols,
					getSubclassTableKeyColumns( j ),
					innerJoin && isClassOrSuperclassTable( j ) && !isInverseTable( j ) && !isNullableTable( j ) ?
					JoinFragment.INNER_JOIN : //we can inner join to superclass tables (the row MUST be there)
					JoinFragment.LEFT_OUTER_JOIN //we can never inner join to subclass tables
				);
		}
	}
	return join;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:21,代码来源:AbstractEntityPersister.java

示例3: toColumns

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String[] toColumns(String alias, String propertyName) throws QueryException {
	//TODO: *two* hashmap lookups here is one too many...
	String[] columns = (String[]) columnsByPropertyPath.get(propertyName);
	if ( columns == null ) {
		throw propertyException( propertyName );
	}
	String[] templates = (String[]) formulaTemplatesByPropertyPath.get(propertyName);
	String[] result = new String[columns.length];
	for ( int i=0; i<columns.length; i++ ) {
		if ( columns[i]==null ) {
			result[i] = StringHelper.replace( templates[i], Template.TEMPLATE, alias );
		}
		else {
			result[i] = StringHelper.qualify( alias, columns[i] );
		}
	}
	return result;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:19,代码来源:AbstractPropertyMapping.java

示例4: getAliasedLHSColumnNames

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
 * Get the aliased columns of the owning entity which are to 
 * be used in the join
 */
public static String[] getAliasedLHSColumnNames(
		AssociationType type, 
		String alias, 
		int property, 
		int begin, 
		OuterJoinLoadable lhsPersister,
		Mapping mapping
) {
	if ( type.useLHSPrimaryKey() ) {
		return StringHelper.qualify( alias, lhsPersister.getIdentifierColumnNames() );
	}
	else {
		String propertyName = type.getLHSPropertyName();
		if (propertyName==null) {
			return ArrayHelper.slice( 
					lhsPersister.toColumns(alias, property), 
					begin, 
					type.getColumnSpan(mapping) 
				);
		}
		else {
			return ( (PropertyMapping) lhsPersister ).toColumns(alias, propertyName); //bad cast
		}
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:30,代码来源:JoinHelper.java

示例5: sqlDropString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema) {
	return "drop index " +
			StringHelper.qualify(
					table.getQualifiedName( dialect, defaultCatalog, defaultSchema ),
					name
			);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:Index.java

示例6: subPath

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
 * Extend the path by the given property name
 */
private static String subPath(String path, String property) {
	if ( path==null || path.length()==0) {
		return property;
	}
	else {
		return StringHelper.qualify(path, property);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:12,代码来源:JoinWalker.java

示例7: generateGeneratedValuesSelectString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
private String generateGeneratedValuesSelectString(ValueInclusion[] inclusions) {
	Select select = new Select( getFactory().getDialect() );

	if ( getFactory().getSettings().isCommentsEnabled() ) {
		select.setComment( "get generated state " + getEntityName() );
	}

	String[] aliasedIdColumns = StringHelper.qualify( getRootAlias(), getIdentifierColumnNames() );

	// Here we render the select column list based on the properties defined as being generated.
	// For partial component generation, we currently just re-select the whole component
	// rather than trying to handle the individual generated portions.
	String selectClause = concretePropertySelectFragment( getRootAlias(), inclusions );
	selectClause = selectClause.substring( 2 );

	String fromClause = fromTableFragment( getRootAlias() ) +
			fromJoinFragment( getRootAlias(), true, false );

	String whereClause = new StringBuffer()
		.append( StringHelper.join( "=? and ", aliasedIdColumns ) )
		.append( "=?" )
		.append( whereJoinFragment( getRootAlias(), true, false ) )
		.toString();

	return select.setSelectClause( selectClause )
			.setFromClause( fromClause )
			.setOuterJoins( "", "" )
			.setWhereClause( whereClause )
			.toStatementString();
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:31,代码来源:AbstractEntityPersister.java

示例8: generateSnapshotSelectString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
protected String generateSnapshotSelectString() {

		//TODO: should we use SELECT .. FOR UPDATE?

		Select select = new Select( getFactory().getDialect() );

		if ( getFactory().getSettings().isCommentsEnabled() ) {
			select.setComment( "get current state " + getEntityName() );
		}

		String[] aliasedIdColumns = StringHelper.qualify( getRootAlias(), getIdentifierColumnNames() );
		String selectClause = StringHelper.join( ", ", aliasedIdColumns ) +
				concretePropertySelectFragment( getRootAlias(), getPropertyUpdateability() );

		String fromClause = fromTableFragment( getRootAlias() ) +
				fromJoinFragment( getRootAlias(), true, false );

		String whereClause = new StringBuffer()
			.append( StringHelper.join( "=? and ",
					aliasedIdColumns ) )
			.append( "=?" )
			.append( whereJoinFragment( getRootAlias(), true, false ) )
			.toString();

		/*if ( isVersioned() ) {
			where.append(" and ")
				.append( getVersionColumnName() )
				.append("=?");
		}*/

		return select.setSelectClause( selectClause )
				.setFromClause( fromClause )
				.setOuterJoins( "", "" )
				.setWhereClause( whereClause )
				.toStatementString();
	}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:37,代码来源:AbstractEntityPersister.java

示例9: toColumns

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String[] toColumns(String name, final int i) {
	final String alias = generateTableAlias( name, getSubclassPropertyTableNumber( i ) );
	String[] cols = getSubclassPropertyColumnNames( i );
	String[] templates = getSubclassPropertyFormulaTemplateClosure()[i];
	String[] result = new String[cols.length];
	for ( int j = 0; j < cols.length; j++ ) {
		if ( cols[j] == null ) {
			result[j] = StringHelper.replace( templates[j], Template.TEMPLATE, alias );
		}
		else {
			result[j] = StringHelper.qualify( alias, cols[j] );
		}
	}
	return result;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:16,代码来源:AbstractEntityPersister.java

示例10: ForUpdateFragment

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public ForUpdateFragment(Dialect dialect, Map lockModes, Map keyColumnNames) throws QueryException {
	this( dialect );
	LockMode upgradeType = null;
	Iterator iter = lockModes.entrySet().iterator();
	while ( iter.hasNext() ) {
		final Map.Entry me = ( Map.Entry ) iter.next();
		final LockMode lockMode = ( LockMode ) me.getValue();
		if ( LockMode.READ.lessThan( lockMode ) ) {
			final String tableAlias = ( String ) me.getKey();
			if ( dialect.forUpdateOfColumns() ) {
				String[] keyColumns = ( String[] ) keyColumnNames.get( tableAlias ); //use the id column alias
				if ( keyColumns == null ) {
					throw new IllegalArgumentException( "alias not found: " + tableAlias );
				}
				keyColumns = StringHelper.qualify( tableAlias, keyColumns );
				for ( int i = 0; i < keyColumns.length; i++ ) {
					addTableAlias( keyColumns[i] );
				}
			}
			else {
				addTableAlias( tableAlias );
			}
			if ( upgradeType != null && lockMode != upgradeType ) {
				throw new QueryException( "mixed LockModes" );
			}
			upgradeType = lockMode;
		}
	}

	if ( upgradeType == LockMode.UPGRADE_NOWAIT ) {
		setNowaitEnabled( true );
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:34,代码来源:ForUpdateFragment.java

示例11: toColumns

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String[] toColumns(String alias, String propertyName) throws QueryException {
	if (propertyName==null || "id".equals(propertyName) ) {
		return StringHelper.qualify(alias, elementColumns);
	}
	else {
		throw new QueryException("cannot dereference scalar collection element: " + propertyName);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:9,代码来源:ElementPropertyMapping.java

示例12: qualify

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
private static String[] qualify(String alias, String[] columnNames, String[] formulaTemplates) {
	int span = columnNames.length;
	String[] result = new String[span];
	for (int i=0; i<span; i++) {
		if ( columnNames[i]==null ) {
			result[i] = StringHelper.replace( formulaTemplates[i], Template.TEMPLATE, alias );
		}
		else {
			result[i] = StringHelper.qualify( alias, columnNames[i] );
		}
	}
	return result;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:14,代码来源:AbstractCollectionPersister.java

示例13: toSubselectString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toSubselectString(String ukname) {
	
	String[] joinColumns = ukname==null ?
		StringHelper.qualify( alias, loadable.getIdentifierColumnNames() ) :
		( (PropertyMapping) loadable ).toColumns(alias, ukname);
	
	return new StringBuffer()
		.append("select ")
		.append( StringHelper.join(", ", joinColumns) )
		.append(queryString)
		.toString();
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:SubselectFetch.java

示例14: getDropIndexSql

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
@Override
public String getDropIndexSql(String table, String indexName)
{
	return "drop index " + StringHelper.qualify(table, quote(indexName));
}
 
开发者ID:equella,项目名称:Equella,代码行数:6,代码来源:SQLServerDialect.java

示例15: bindCompositeId

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public static void bindCompositeId(Element node, Component component,
		PersistentClass persistentClass, String propertyName, Mappings mappings,
		java.util.Map inheritedMetas) throws MappingException {

	component.setKey( true );

	String path = StringHelper.qualify(
			persistentClass.getEntityName(),
			propertyName == null ? "id" : propertyName );

	bindComponent(
			node,
			component,
			persistentClass.getClassName(),
			propertyName,
			path,
			false,
			node.attribute( "class" ) == null
					&& propertyName == null,
			mappings,
			inheritedMetas,
			false
		);

	if ( "true".equals( node.attributeValue("mapped") ) ) {
		if ( propertyName!=null ) {
			throw new MappingException("cannot combine mapped=\"true\" with specified name");
		}
		Component mapper = new Component(persistentClass);
		bindComponent(
				node,
				mapper,
				persistentClass.getClassName(),
				null,
				path,
				false,
				true,
				mappings,
				inheritedMetas,
				true
			);
		persistentClass.setIdentifierMapper(mapper);
		Property property = new Property();
		property.setName("_identifierMapper");
		property.setNodeName("id");
		property.setUpdateable(false);
		property.setInsertable(false);
		property.setValue(mapper);
		property.setPropertyAccessorName( "embedded" );
		persistentClass.addProperty(property);
	}

}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:54,代码来源:HbmBinder.java


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