org.hibernate.internal.util.collections.ArrayHelper#toIntArray ( )源码实例Demo

下面列出了org.hibernate.internal.util.collections.ArrayHelper#toIntArray ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lams   文件: HqlSqlWalker.java
/**
 * Returns the locations of all occurrences of the named parameter.
 */
public int[] getNamedParameterLocations(String name) throws QueryException {
	Object o = namedParameters.get( name );
	if ( o == null ) {
		throw new QueryException(
				QueryTranslator.ERROR_NAMED_PARAMETER_DOES_NOT_APPEAR + name,
				queryTranslatorImpl.getQueryString()
		);
	}
	if ( o instanceof Integer ) {
		return new int[] {(Integer) o};
	}
	else {
		return ArrayHelper.toIntArray( (ArrayList) o );
	}
}
 
源代码2 项目: lams   文件: ParamLocationRecognizer.java
private NamedParameterDescriptor complete() {
	return new NamedParameterDescriptor(
			name,
			null,
			ArrayHelper.toIntArray( sourcePositions )
	);
}
 
源代码3 项目: lams   文件: ParamLocationRecognizer.java
private OrdinalParameterDescriptor complete() {
	return new OrdinalParameterDescriptor(
			identifier,
			identifier - 1,
			null,
			ArrayHelper.toIntArray( sourcePositions )
	);
}
 
源代码4 项目: lams   文件: StringHelper.java
public static int[] locateUnquoted(String string, char character) {
	if ( '\'' == character ) {
		throw new IllegalArgumentException( "Unquoted count of quotes is invalid" );
	}
	if ( string == null ) {
		return new int[0];
	}

	ArrayList locations = new ArrayList( 20 );

	// Impl note: takes advantage of the fact that an escpaed single quote
	// embedded within a quote-block can really be handled as two seperate
	// quote-blocks for the purposes of this method...
	int stringLength = string.length();
	boolean inQuote = false;
	for ( int indx = 0; indx < stringLength; indx++ ) {
		char c = string.charAt( indx );
		if ( inQuote ) {
			if ( '\'' == c ) {
				inQuote = false;
			}
		}
		else if ( '\'' == c ) {
			inQuote = true;
		}
		else if ( c == character ) {
			locations.add( indx );
		}
	}
	return ArrayHelper.toIntArray( locations );
}
 
源代码5 项目: lams   文件: QueryTranslatorImpl.java
@Override
public int[] getNamedParameterLocs(String name) throws QueryException {
	Object o = namedParameters.get( name );
	if ( o == null ) {
		throw new QueryException( ERROR_NAMED_PARAMETER_DOES_NOT_APPEAR + name, queryString );
	}
	if ( o instanceof Integer ) {
		return new int[] {(Integer) o};
	}
	else {
		return ArrayHelper.toIntArray( (ArrayList) o );
	}
}
 
源代码6 项目: lams   文件: NamedParameterInformationImpl.java
@Override
public int[] getSourceLocations() {
	return ArrayHelper.toIntArray( sqlPositions );
}
 
源代码7 项目: lams   文件: PositionalParameterInformationImpl.java
@Override
public int[] getSourceLocations() {
	return ArrayHelper.toIntArray( sourceLocations );
}
 
源代码8 项目: lams   文件: AbstractParameterInformation.java
@Override
public int[] getSourceLocations() {
	return ArrayHelper.toIntArray( sqlPositions );
}