com.xpn.xwiki.store.hibernate.query
Class HqlQueryExecutor
java.lang.Object
com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor
- All Implemented Interfaces:
- org.xwiki.component.phase.Initializable, QueryExecutor
@Component
@Named(value="hql")
@Singleton
public class HqlQueryExecutor
- extends Object
- implements QueryExecutor, org.xwiki.component.phase.Initializable
QueryExecutor implementation for Hibernate Store.
- Since:
- 1.6M1
- Version:
- $Id: 547a29631a347d5051c823f049fcdc3bdafff289 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HqlQueryExecutor
public HqlQueryExecutor()
initialize
public void initialize()
throws org.xwiki.component.phase.InitializationException
- Specified by:
initialize
in interface org.xwiki.component.phase.Initializable
- Throws:
org.xwiki.component.phase.InitializationException
execute
public <T> List<T> execute(Query query)
throws QueryException
- Specified by:
execute
in interface QueryExecutor
- Throws:
QueryException
completeShortFormStatement
protected String completeShortFormStatement(String statement)
- Append the required select clause to HQL short query statements. Short statements are the only way for users
without programming rights to perform queries. Such statements can be for example:
, BaseObject obj where doc.fullName=obj.name and obj.className='XWiki.MyClass'
where doc.creationDate > '2008-01-01'
- Parameters:
statement
- the statement to complete if required.
- Returns:
- the complete statement if it had to be completed, the original one otherwise.
createHibernateQuery
protected org.hibernate.Query createHibernateQuery(org.hibernate.Session session,
Query query)
- Parameters:
session
- hibernate sessionquery
- Query object
- Returns:
- hibernate query
populateParameters
protected void populateParameters(org.hibernate.Query hquery,
Query query)
- Parameters:
hquery
- query to populate parametersquery
- query from to populate.
getStore
protected XWikiHibernateStore getStore()
- Returns:
- Store component
getContext
protected XWikiContext getContext()
- Returns:
- XWiki Context
Copyright © 2004–2014 XWiki. All rights reserved.