|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.hql.internal.ast.QueryTranslatorImpl
public class QueryTranslatorImpl
A QueryTranslator that uses an Antlr-based parser.
Nested Class Summary | |
---|---|
static class |
QueryTranslatorImpl.JavaConstantConverter
|
Field Summary |
---|
Fields inherited from interface org.hibernate.hql.spi.QueryTranslator |
---|
ERROR_CANNOT_DETERMINE_TYPE, ERROR_CANNOT_FETCH_WITH_ITERATE, ERROR_CANNOT_FORMAT_LITERAL, ERROR_NAMED_PARAMETER_DOES_NOT_APPEAR |
Constructor Summary | |
---|---|
QueryTranslatorImpl(String queryIdentifier,
String query,
Map enabledFilters,
SessionFactoryImplementor factory)
Creates a new AST-based query translator. |
Method Summary | |
---|---|
List<String> |
collectSqlStrings()
|
void |
compile(Map replacements,
boolean shallow)
Compile a "normal" query. |
void |
compile(String collectionRole,
Map replacements,
boolean shallow)
Compile a filter. |
boolean |
containsCollectionFetches()
Does the translated query contain collection fetches? |
int |
executeUpdate(QueryParameters queryParameters,
SessionImplementor session)
Perform a bulk update/delete operation given the underlying query definition. |
List |
getCollectedParameterSpecifications()
|
String[][] |
getColumnNames()
Returns the column names in the generated SQL. |
Class |
getDynamicInstantiationResultType()
|
Map |
getEnabledFilters()
Returns the filters enabled for this query translator. |
int[] |
getNamedParameterLocs(String name)
|
ParameterTranslations |
getParameterTranslations()
Return information about any parameters encountered during translation. |
String |
getQueryIdentifier()
Retrieve the query identifier for this translator. |
Set |
getQuerySpaces()
Returns the set of query spaces (table names) that the query refers to. |
String |
getQueryString()
Returns the HQL string processed by the translator. |
String[] |
getReturnAliases()
Returns an array of HQL aliases |
Type[] |
getReturnTypes()
Types of the return values of an iterate() style query. |
Statement |
getSqlAST()
|
String |
getSQLString()
The SQL query string to be called; implemented by all subclasses |
boolean |
isManipulationStatement()
|
boolean |
isShallowQuery()
|
Iterator |
iterate(QueryParameters queryParameters,
EventSource session)
Return the query results as an iterator |
List |
list(SessionImplementor session,
QueryParameters queryParameters)
Perform a list operation given the underlying query definition. |
ScrollableResults |
scroll(QueryParameters queryParameters,
SessionImplementor session)
Return the query results, as an instance of ScrollableResults |
void |
validateScrollability()
Validate the scrollability of the translated query. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueryTranslatorImpl(String queryIdentifier, String query, Map enabledFilters, SessionFactoryImplementor factory)
queryIdentifier
- The query-identifier (used in stats collection)query
- The hql query to translateenabledFilters
- Currently enabled filtersfactory
- The session factory constructing this translator instance.Method Detail |
---|
public void compile(Map replacements, boolean shallow) throws QueryException, MappingException
compile
in interface QueryTranslator
replacements
- Defined query substitutions.shallow
- Does this represent a shallow (scalar or entity-id) select?
QueryException
- There was a problem parsing the query string.
MappingException
- There was a problem querying defined mappings.public void compile(String collectionRole, Map replacements, boolean shallow) throws QueryException, MappingException
compile
in interface FilterTranslator
collectionRole
- the role name of the collection used as the basis for the filter.replacements
- Defined query substitutions.shallow
- Does this represent a shallow (scalar or entity-id) select?
QueryException
- There was a problem parsing the query string.
MappingException
- There was a problem querying defined mappings.public String getQueryIdentifier()
QueryTranslator
getQueryIdentifier
in interface QueryTranslator
public Statement getSqlAST()
public Type[] getReturnTypes()
getReturnTypes
in interface QueryTranslator
public String[] getReturnAliases()
QueryTranslator
getReturnAliases
in interface QueryTranslator
public String[][] getColumnNames()
QueryTranslator
getColumnNames
in interface QueryTranslator
public Set getQuerySpaces()
QueryTranslator
getQuerySpaces
in interface QueryTranslator
public List list(SessionImplementor session, QueryParameters queryParameters) throws HibernateException
QueryTranslator
list
in interface QueryTranslator
session
- The session owning this query.queryParameters
- The query bind parameters.
HibernateException
public Iterator iterate(QueryParameters queryParameters, EventSource session) throws HibernateException
iterate
in interface QueryTranslator
queryParameters
- The query bind parameters.session
- The session owning this query.
HibernateException
public ScrollableResults scroll(QueryParameters queryParameters, SessionImplementor session) throws HibernateException
scroll
in interface QueryTranslator
queryParameters
- The query bind parameters.session
- The session owning this query.
HibernateException
public int executeUpdate(QueryParameters queryParameters, SessionImplementor session) throws HibernateException
QueryTranslator
executeUpdate
in interface QueryTranslator
queryParameters
- The query bind parameters.session
- The session owning this query.
HibernateException
public String getSQLString()
getSQLString
in interface QueryTranslator
public List<String> collectSqlStrings()
collectSqlStrings
in interface QueryTranslator
public boolean isShallowQuery()
public String getQueryString()
QueryTranslator
getQueryString
in interface QueryTranslator
public Map getEnabledFilters()
QueryTranslator
getEnabledFilters
in interface QueryTranslator
public int[] getNamedParameterLocs(String name)
public boolean containsCollectionFetches()
QueryTranslator
containsCollectionFetches
in interface QueryTranslator
public boolean isManipulationStatement()
isManipulationStatement
in interface QueryTranslator
public void validateScrollability() throws HibernateException
QueryTranslator
validateScrollability
in interface QueryTranslator
HibernateException
public ParameterTranslations getParameterTranslations()
QueryTranslator
getParameterTranslations
in interface QueryTranslator
public List getCollectedParameterSpecifications()
public Class getDynamicInstantiationResultType()
getDynamicInstantiationResultType
in interface QueryTranslator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |