FileDocCategorySizeDatePackage
ParamLocationRecognizer.javaAPI DocHibernate 3.2.53093Wed Jun 28 08:25:00 BST 2006org.hibernate.engine.query

ParamLocationRecognizer

public class ParamLocationRecognizer extends Object implements ParameterParser.Recognizer
Implements a parameter parser recognizer specifically for the purpose of journaling parameter locations.
author
Steve Ebersole

Fields Summary
private Map
namedParameterDescriptions
private List
ordinalParameterLocationList
Constructors Summary
Methods Summary
public java.util.MapgetNamedParameterDescriptionMap()
Returns the map of named parameter locations. The map is keyed by parameter name; the corresponding value is a (@link NamedParameterDescription}.

return
The map of named parameter locations.

		return namedParameterDescriptions;
	
private org.hibernate.engine.query.ParamLocationRecognizer$NamedParameterDescriptiongetOrBuildNamedParameterDescription(java.lang.String name, boolean jpa)

		NamedParameterDescription desc = ( NamedParameterDescription ) namedParameterDescriptions.get( name );
		if ( desc == null ) {
			desc = new NamedParameterDescription( jpa );
			namedParameterDescriptions.put( name, desc );
		}
		return desc;
	
public java.util.ListgetOrdinalParameterLocationList()
Returns the list of ordinal parameter locations. The list elements are Integers, representing the location for that given ordinal. Thus {@link #getOrdinalParameterLocationList()}.elementAt(n) represents the location for the nth parameter.

return
The list of ordinal parameter locations.

		return ordinalParameterLocationList;
	
public voidjpaPositionalParameter(java.lang.String name, int position)

		getOrBuildNamedParameterDescription( name, true ).add( position );
	
public voidnamedParameter(java.lang.String name, int position)

		getOrBuildNamedParameterDescription( name, false ).add( position );
	
public voidordinalParameter(int position)

		ordinalParameterLocationList.add( new Integer( position ) );
	
public voidother(char character)

		// don't care...
	
public voidoutParameter(int position)

		// don't care...
	
public static org.hibernate.engine.query.ParamLocationRecognizerparseLocations(java.lang.String query)
Convenience method for creating a param location recognizer and initiating the parse.

param
query The query to be parsed for parameter locations.
return
The generated recognizer, with journaled location info.


	                              	 
	     
		ParamLocationRecognizer recognizer = new ParamLocationRecognizer();
		ParameterParser.parse( query, recognizer );
		return recognizer;