Java Code Examples for org.hibernate.QueryException#setQueryString()

The following examples show how to use org.hibernate.QueryException#setQueryString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HqlSqlWalker.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * 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 ) {
		QueryException qe = new QueryException( QueryTranslator.ERROR_NAMED_PARAMETER_DOES_NOT_APPEAR + name );
		qe.setQueryString( queryTranslatorImpl.getQueryString() );
		throw qe;
	}
	if ( o instanceof Integer ) {
		return new int[]{( ( Integer ) o ).intValue()};
	}
	else {
		return ArrayHelper.toIntArray( ( ArrayList ) o );
	}
}
 
Example 2
Source File: QueryTranslatorImpl.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public int[] getNamedParameterLocs(String name) throws QueryException {
	Object o = namedParameters.get( name );
	if ( o == null ) {
		QueryException qe = new QueryException( ERROR_NAMED_PARAMETER_DOES_NOT_APPEAR + name );
		qe.setQueryString( queryString );
		throw qe;
	}
	if ( o instanceof Integer ) {
		return new int[]{ ( ( Integer ) o ).intValue() };
	}
	else {
		return ArrayHelper.toIntArray( ( ArrayList ) o );
	}
}