Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.hibernate.hql.ast.QueryTranslatorImpl
Nested Class Summary | |
static class |
Fields inherited from interface org.hibernate.hql.QueryTranslator | |
ERROR_CANNOT_DETERMINE_TYPE , ERROR_CANNOT_FETCH_WITH_ITERATE , ERROR_CANNOT_FORMAT_LITERAL , ERROR_NAMED_PARAMETER_DOES_NOT_APPEAR |
Constructor Summary | |
|
Method Summary | |
List | |
void |
|
void |
|
boolean | |
int |
|
String[][] | |
Map | |
int[] |
|
ParameterTranslations | |
String | |
Set | |
String | |
String[] | |
Type[] |
|
String |
|
Statement | |
boolean | |
boolean | |
Iterator |
|
List |
|
ScrollableResults |
|
void |
public QueryTranslatorImpl(String queryIdentifier, String query, Map enabledFilters, SessionFactoryImplementor factory)
Creates a new AST-based query translator.
- Parameters:
queryIdentifier
- The query-identifier (used in stats collection)query
- The hql query to translateenabledFilters
- Currently enabled filtersfactory
- The session factory constructing this translator instance.
public List collectSqlStrings()
- Specified by:
- collectSqlStrings in interface QueryTranslator
public void compile(Map replacements, boolean shallow) throws QueryException, MappingException
Compile a "normal" query. This method may be called multiple times. Subsequent invocations are no-ops.
- Specified by:
- compile in interface QueryTranslator
- Parameters:
replacements
- Defined query substitutions.shallow
- Does this represent a shallow (scalar or entity-id) select?
- Throws:
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 a filter. This method may be called multiple times. Subsequent invocations are no-ops.
- Specified by:
- compile in interface FilterTranslator
- Parameters:
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?
- Throws:
QueryException
- There was a problem parsing the query string.MappingException
- There was a problem querying defined mappings.
public boolean containsCollectionFetches()
- Specified by:
- containsCollectionFetches in interface QueryTranslator
public int executeUpdate(QueryParameters queryParameters, SessionImplementor session) throws HibernateException
- Specified by:
- executeUpdate in interface QueryTranslator
public String[][] getColumnNames()
- Specified by:
- getColumnNames in interface QueryTranslator
public Map getEnabledFilters()
- Specified by:
- getEnabledFilters in interface QueryTranslator
public int[] getNamedParameterLocs(String name)
public ParameterTranslations getParameterTranslations()
- Specified by:
- getParameterTranslations in interface QueryTranslator
public String getQueryIdentifier()
- Specified by:
- getQueryIdentifier in interface QueryTranslator
public String getQueryString()
- Specified by:
- getQueryString in interface QueryTranslator
public String[] getReturnAliases()
- Specified by:
- getReturnAliases in interface QueryTranslator
public Type[] getReturnTypes()
Types of the return values of an iterate() style query.
- Specified by:
- getReturnTypes in interface QueryTranslator
- Returns:
- an array of Types.
public String getSQLString()
The SQL query string to be called; implemented by all subclasses
- Specified by:
- getSQLString in interface QueryTranslator
public boolean isManipulationStatement()
- Specified by:
- isManipulationStatement in interface QueryTranslator
public boolean isShallowQuery()
public Iterator iterate(QueryParameters queryParameters, EventSource session) throws HibernateException
Return the query results as an iterator
- Specified by:
- iterate in interface QueryTranslator
public List list(SessionImplementor session, QueryParameters queryParameters) throws HibernateException
- Specified by:
- list in interface QueryTranslator
public ScrollableResults scroll(QueryParameters queryParameters, SessionImplementor session) throws HibernateException
Return the query results, as an instance of ScrollableResults
- Specified by:
- scroll in interface QueryTranslator
public void validateScrollability() throws HibernateException
- Specified by:
- validateScrollability in interface QueryTranslator