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


Java StringHelper.join方法代码示例

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


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

示例1: getAddForeignKeyConstraintString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String getAddForeignKeyConstraintString(
		String constraintName,
		String[] foreignKey,
		String referencedTable,
		String[] primaryKey, boolean referencesPrimaryKey
) {
	String cols = StringHelper.join(", ", foreignKey);
	return new StringBuffer(30)
		.append(" add index ")
		.append(constraintName)
		.append(" (")
		.append(cols)
		.append("), add constraint ")
		.append(constraintName)
		.append(" foreign key (")
		.append(cols)
		.append(") references ")
		.append(referencedTable)
		.append(" (")
		.append( StringHelper.join(", ", primaryKey) )
		.append(')')
		.toString();
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:24,代码来源:MySQLDialect.java

示例2: getIdentityColumn

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String getIdentityColumn() {
	checkInitialized();
	String table = getTableAlias();
	if ( table == null ) {
		throw new IllegalStateException( "No table alias for node " + this );
	}
	String[] cols;
	String propertyName;
	if ( getEntityPersister() != null && getEntityPersister().getEntityMetamodel() != null
			&& getEntityPersister().getEntityMetamodel().hasNonIdentifierPropertyNamedId() ) {
		propertyName = getEntityPersister().getIdentifierPropertyName();
	}
	else {
		propertyName = EntityPersister.ENTITY_ID;
	}
	if ( getWalker().getStatementType() == HqlSqlWalker.SELECT ) {
		cols = getPropertyMapping( propertyName ).toColumns( table, propertyName );
	}
	else {
		cols = getPropertyMapping( propertyName ).toColumns( propertyName );
	}
	String result = StringHelper.join( ", ", cols );
	return  cols.length == 1 ? result : "(" + result + ")";
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:25,代码来源:FromElement.java

示例3: toSqlString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
	return StringHelper.join(
		" and ",
		StringHelper.suffix( criteriaQuery.getColumnsUsingProjection(criteria, propertyName), " between ? and ?" )
	);

	//TODO: get SQL rendering out of this package!
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:10,代码来源:BetweenExpression.java

示例4: toSqlString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
	String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName);
	String result = StringHelper.join(
		" or ",
		StringHelper.suffix( columns, " is not null" )
	);
	if (columns.length>1) result = '(' + result + ')';
	return result;

	//TODO: get SQL rendering out of this package!
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:NotNullExpression.java

示例5: toSqlString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {

	String[] columns = criteriaQuery.getIdentifierColumns(criteria);

	String result = StringHelper.join(
		" and ",
		StringHelper.suffix( columns, " = ?" )
	);
	if (columns.length>1) result = '(' + result + ')';
	return result;

	//TODO: get SQL rendering out of this package!
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:15,代码来源:IdentifierEqExpression.java

示例6: toSqlString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
	String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName);
	String singleValueParam = StringHelper.repeat( "?, ", columns.length-1 )  + "?";
	if ( columns.length>1 ) singleValueParam = '(' + singleValueParam + ')';
	String params = values.length>0 ?
		StringHelper.repeat( singleValueParam + ", ", values.length-1 ) + singleValueParam :
		"";
	String cols = StringHelper.join(", ", columns);
	if ( columns.length>1 ) cols = '(' + cols + ')';
	return cols + " in (" + params + ')';
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:InExpression.java

示例7: toSqlString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) 
throws HibernateException {
	String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName);
	String result = StringHelper.join(
		" and ",
		StringHelper.suffix( columns, " is null" )
	);
	if (columns.length>1) result = '(' + result + ')';
	return result;

	//TODO: get SQL rendering out of this package!
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:NullExpression.java

示例8: toGroupSqlString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery) 
throws HibernateException {
	if (!grouped) {
		return super.toGroupSqlString(criteria, criteriaQuery);
	}
	else {
		return StringHelper.join( ", ", criteriaQuery.getIdentifierColumns(criteria) );
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:10,代码来源:IdentifierProjection.java

示例9: toSqlString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) 
throws HibernateException {
	String[] xcols = criteriaQuery.getColumnsUsingProjection(criteria, propertyName);
	String[] ycols = criteriaQuery.getColumnsUsingProjection(criteria, otherPropertyName);
	String result = StringHelper.join(
		" and ",
		StringHelper.add(xcols, getOp(), ycols)
	);
	if (xcols.length>1) result = '(' + result + ')';
	return result;
	//TODO: get SQL rendering out of this package!
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:PropertyExpression.java

示例10: 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

示例11: initText

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
private void initText() {
	String[] cols = getColumns();
	String text = StringHelper.join( ", ", cols );
	if ( cols.length > 1 && getWalker().isComparativeExpressionClause() ) {
		text = "(" + text + ")";
	}
	setText( text );
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:9,代码来源:DotNode.java

示例12: resolveAsNakedPropertyRef

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
private int resolveAsNakedPropertyRef() {
	FromElement fromElement = locateSingleFromElement();
	if (fromElement == null) {
		return UNKNOWN;
	}
	Queryable persister = fromElement.getQueryable();
	if (persister == null) {
		return UNKNOWN;
	}
	Type propertyType = getNakedPropertyType(fromElement);
	if (propertyType == null) {
		// assume this ident's text does *not* refer to a property on the given persister
		return UNKNOWN;
	}

	if ((propertyType.isComponentType() || propertyType.isAssociationType() )) {
		return COMPONENT_REF;
	}

	setFromElement(fromElement);
	String property = getText();
	String[] columns = getWalker().isSelectStatement()
			? persister.toColumns(fromElement.getTableAlias(), property)
			: persister.toColumns(property);
	String text = StringHelper.join(", ", columns);
	setText(columns.length == 1 ? text : "(" + text + ")");
	setType(SqlTokenTypes.SQL_TOKEN);

	// these pieces are needed for usage in select clause
	super.setDataType(propertyType);
	nakedPropertyRef = true;

	return PROPERTY_REF;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:35,代码来源:IdentNode.java

示例13: toString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
 * @see java.lang.Object#toString()
 */
public String toString() {
	return '(' + StringHelper.join( ' ' + op + ' ', criteria.iterator() ) + ')';
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:7,代码来源:Junction.java

示例14: join

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
private String join(String[] aliases) {
	if ( aliases == null) return null;

	return StringHelper.join( ", ", aliases );
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:6,代码来源:GeneratedCollectionAliases.java

示例15: createWhereByKey

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
protected String createWhereByKey(int tableNumber, String alias) {
	//TODO: move to .sql package, and refactor with similar things!
	return StringHelper.join( "=? and ",
			StringHelper.qualify( alias, getSubclassTableKeyColumns( tableNumber ) ) ) + "=?";
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:6,代码来源:AbstractEntityPersister.java


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