org.hibernate.engine.query

Class ParamLocationRecognizer

Implemented Interfaces:
ParameterParser.Recognizer

public class ParamLocationRecognizer
extends java.lang.Object
implements ParameterParser.Recognizer

Implements a parameter parser recognizer specifically for the purpose of journaling parameter locations.
Author:
Steve Ebersole

Nested Class Summary

static class
ParamLocationRecognizer.NamedParameterDescription

Method Summary

Map
getNamedParameterDescriptionMap()
Returns the map of named parameter locations.
List
getOrdinalParameterLocationList()
Returns the list of ordinal parameter locations.
void
jpaPositionalParameter(String name, int position)
void
namedParameter(String name, int position)
void
ordinalParameter(int position)
void
other(char character)
void
outParameter(int position)
static ParamLocationRecognizer
parseLocations(String query)
Convenience method for creating a param location recognizer and initiating the parse.

Method Details

getNamedParameterDescriptionMap

public Map getNamedParameterDescriptionMap()
Returns the map of named parameter locations. The map is keyed by parameter name; the corresponding value is a (@link NamedParameterDescription}.
Returns:
The map of named parameter locations.

getOrdinalParameterLocationList

public List getOrdinalParameterLocationList()
Returns:
The list of ordinal parameter locations.

jpaPositionalParameter

public void jpaPositionalParameter(String name,
                                   int position)
Specified by:
jpaPositionalParameter in interface ParameterParser.Recognizer

namedParameter

public void namedParameter(String name,
                           int position)
Specified by:
namedParameter in interface ParameterParser.Recognizer

ordinalParameter

public void ordinalParameter(int position)
Specified by:
ordinalParameter in interface ParameterParser.Recognizer

other

public void other(char character)
Specified by:
other in interface ParameterParser.Recognizer

outParameter

public void outParameter(int position)
Specified by:
outParameter in interface ParameterParser.Recognizer

parseLocations

public static ParamLocationRecognizer parseLocations(String query)
Convenience method for creating a param location recognizer and initiating the parse.
Parameters:
query - The query to be parsed for parameter locations.
Returns:
The generated recognizer, with journaled location info.