|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.hibernate.loader.Loader net.sf.hibernate.hql.QueryTranslator
An instance of QueryTranslator translates a Hibernate query string to SQL.
Field Summary |
Fields inherited from class net.sf.hibernate.loader.Loader |
NO_SUFFIX |
Constructor Summary | |
QueryTranslator(String queryString)
Construct a query translator |
Method Summary | |
protected void |
addFromAssociation(String elementName,
String collectionRole)
Used for collection filters |
protected String |
applyLocks(String sql,
Map lockModes,
Dialect dialect)
Append FOR UPDATE OF clause, if necessary. |
protected int |
bindNamedParameters(PreparedStatement ps,
Map namedParams,
int start,
SessionImplementor session)
Bind named parameters to the PreparedStatement. |
void |
compile(SessionFactoryImplementor factory,
Map replacements,
boolean scalar)
Compile a "normal" query. |
static String[] |
concreteQueries(String query,
SessionFactoryImplementor factory)
Handle Hibernate "implicit" polymorphism, by translating the query string into several "concrete" queries against mapped classes. |
protected int |
getCollectionOwner()
Get the index of the entity that owns the collection, or -1 if there is no owner in the query results (ie. |
protected CollectionPersister |
getCollectionPersister()
Overrides method from Loader |
protected SessionFactoryImplementor |
getFactory()
|
protected LockMode[] |
getLockModes(Map lockModes)
What lock mode does this load entities with? |
protected int[] |
getNamedParameterLocs(String name)
|
protected int[] |
getOwners()
An array of indexes of the entity that owns a one-to-one association to the entity at the given index (-1 if there is no "owner") |
protected Loadable[] |
getPersisters()
Persisters for the return values of a find() style query. |
Set |
getQuerySpaces()
|
protected Object |
getResultColumnOrRow(Object[] row,
ResultSet rs,
SessionImplementor session)
Get the actual object that is returned in the user-visible result list. |
protected List |
getResultList(List results)
|
Type[] |
getReturnTypes()
Types of the return values of an iterate() style query. |
String |
getSQLString()
The SQL query string to be called; implemented by all subclasses |
protected String[] |
getSuffixes()
The suffix identifies a particular column of results in the SQL ResultSet; implemented by all subclasses |
protected boolean |
isCompiled()
|
Iterator |
iterate(QueryParameters queryParameters,
SessionImplementor session)
Return the query results as an iterator |
List |
list(SessionImplementor session,
QueryParameters queryParameters)
|
Object |
loadSingleRow(ResultSet resultSet,
SessionImplementor session,
QueryParameters queryParameters,
boolean returnProxies)
|
ScrollableResults |
scroll(QueryParameters queryParameters,
SessionImplementor session)
Return the query results, as an instance of ScrollableResults |
protected void |
setFactory(SessionFactoryImplementor factory)
|
String |
toString()
|
protected boolean |
upgradeLocks()
Does this query return objects that might be already cached by the session, whose lock mode may need upgrading |
Methods inherited from class net.sf.hibernate.loader.Loader |
bindPositionalParameters, doList, generateAlias, generateSuffixes, getResultSet, isSingleRowLoader, list, loadCollection, loadCollectionBatch, loadEntity, loadEntityBatch, postInstantiate, prepareQueryStatement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public QueryTranslator(String queryString)
Method Detail |
public void compile(SessionFactoryImplementor factory, Map replacements, boolean scalar) throws QueryException, MappingException
QueryException
MappingException
public Object loadSingleRow(ResultSet resultSet, SessionImplementor session, QueryParameters queryParameters, boolean returnProxies) throws SQLException, HibernateException
loadSingleRow
in class Loader
SQLException
HibernateException
protected Loadable[] getPersisters()
getPersisters
in class Loader
public Type[] getReturnTypes()
public String getSQLString()
Loader
getSQLString
in class Loader
protected int[] getNamedParameterLocs(String name) throws QueryException
QueryException
public final Set getQuerySpaces()
protected CollectionPersister getCollectionPersister()
getCollectionPersister
in class Loader
protected String[] getSuffixes()
Loader
getSuffixes
in class Loader
protected void addFromAssociation(String elementName, String collectionRole) throws QueryException
QueryException
protected int bindNamedParameters(PreparedStatement ps, Map namedParams, int start, SessionImplementor session) throws SQLException, HibernateException
Loader
bindNamedParameters
in class Loader
SQLException
HibernateException
public List list(SessionImplementor session, QueryParameters queryParameters) throws HibernateException, SQLException
HibernateException
SQLException
public Iterator iterate(QueryParameters queryParameters, SessionImplementor session) throws HibernateException, SQLException
HibernateException
SQLException
public ScrollableResults scroll(QueryParameters queryParameters, SessionImplementor session) throws HibernateException, SQLException
HibernateException
SQLException
public static String[] concreteQueries(String query, SessionFactoryImplementor factory)
protected Object getResultColumnOrRow(Object[] row, ResultSet rs, SessionImplementor session) throws SQLException, HibernateException
Loader
getResultColumnOrRow
in class Loader
SQLException
HibernateException
protected List getResultList(List results) throws QueryException
getResultList
in class Loader
QueryException
protected LockMode[] getLockModes(Map lockModes)
Loader
getLockModes
in class Loader
lockModes
- a collection of lock modes specified dynamically via the Query interfaceprotected String applyLocks(String sql, Map lockModes, Dialect dialect) throws QueryException
Loader
applyLocks
in class Loader
QueryException
protected boolean upgradeLocks()
Loader
upgradeLocks
in class Loader
protected int getCollectionOwner()
Loader
getCollectionOwner
in class Loader
protected void setFactory(SessionFactoryImplementor factory)
protected SessionFactoryImplementor getFactory()
protected boolean isCompiled()
public String toString()
protected int[] getOwners()
Loader
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |