Package org.hibernate.engine.query.spi
Class ParamLocationRecognizer
- java.lang.Object
-
- org.hibernate.engine.query.spi.ParamLocationRecognizer
-
- All 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParamLocationRecognizer.InFlightJpaOrdinalParameterStateInternal in-flight representation of a recognized named parameterstatic classParamLocationRecognizer.InFlightNamedParameterStateInternal in-flight representation of a recognized named parameterstatic classParamLocationRecognizer.InFlightOrdinalParameterStateInternal in-flight representation of a recognized named parameter
-
Constructor Summary
Constructors Constructor Description ParamLocationRecognizer(int jdbcStyleOrdinalCountBase)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete()java.util.Map<java.lang.String,NamedParameterDescriptor>getNamedParameterDescriptionMap()java.util.Map<java.lang.Integer,OrdinalParameterDescriptor>getOrdinalParameterDescriptionMap()voidjpaPositionalParameter(int name, int position)Called when a JPA-style named parameter is recognizedvoidnamedParameter(java.lang.String name, int position)Called when a named parameter is recognizedvoidordinalParameter(int position)Called when an ordinal parameter is recognizedvoidother(char character)Called when a character that is not a parameter (or part of a parameter definition) is recognized.voidoutParameter(int position)Called when an output parameter is recognizedstatic ParamLocationRecognizerparseLocations(java.lang.String query, SessionFactoryImplementor sessionFactory)Convenience method for creating a param location recognizer and initiating the parse.
-
-
-
Method Detail
-
parseLocations
public static ParamLocationRecognizer parseLocations(java.lang.String query, SessionFactoryImplementor sessionFactory)
Convenience method for creating a param location recognizer and initiating the parse.- Parameters:
query- The query to be parsed for parameter locations.sessionFactory-- Returns:
- The generated recognizer, with journaled location info.
-
complete
public void complete()
- Specified by:
completein interfaceParameterParser.Recognizer
-
getNamedParameterDescriptionMap
public java.util.Map<java.lang.String,NamedParameterDescriptor> getNamedParameterDescriptionMap()
-
getOrdinalParameterDescriptionMap
public java.util.Map<java.lang.Integer,OrdinalParameterDescriptor> getOrdinalParameterDescriptionMap()
-
ordinalParameter
public void ordinalParameter(int position)
Description copied from interface:ParameterParser.RecognizerCalled when an ordinal parameter is recognized- Specified by:
ordinalParameterin interfaceParameterParser.Recognizer- Parameters:
position- The position within the query
-
namedParameter
public void namedParameter(java.lang.String name, int position)Description copied from interface:ParameterParser.RecognizerCalled when a named parameter is recognized- Specified by:
namedParameterin interfaceParameterParser.Recognizer- Parameters:
name- The recognized parameter nameposition- The position within the query
-
jpaPositionalParameter
public void jpaPositionalParameter(int name, int position)Description copied from interface:ParameterParser.RecognizerCalled when a JPA-style named parameter is recognized- Specified by:
jpaPositionalParameterin interfaceParameterParser.Recognizer- Parameters:
name- The identifier (name) of the JPA-style parameterposition- The position within the query
-
other
public void other(char character)
Description copied from interface:ParameterParser.RecognizerCalled when a character that is not a parameter (or part of a parameter definition) is recognized.- Specified by:
otherin interfaceParameterParser.Recognizer- Parameters:
character- The recognized character
-
outParameter
public void outParameter(int position)
Description copied from interface:ParameterParser.RecognizerCalled when an output parameter is recognized- Specified by:
outParameterin interfaceParameterParser.Recognizer- Parameters:
position- The position within the query
-
-