com.xpn.xwiki.store.hibernate.query
Class HqlQueryExecutor

java.lang.Object
  extended by 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 $

Constructor Summary
HqlQueryExecutor()
           
 
Method Summary
protected  String completeShortFormStatement(String statement)
          Append the required select clause to HQL short query statements.
protected  org.hibernate.Query createHibernateQuery(org.hibernate.Session session, Query query)
           
<T> List<T>
execute(Query query)
           
protected  XWikiContext getContext()
           
protected  XWikiHibernateStore getStore()
           
 void initialize()
           
protected  void populateParameters(org.hibernate.Query hquery, Query query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HqlQueryExecutor

public HqlQueryExecutor()
Method Detail

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:

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 session
query - Query object
Returns:
hibernate query

populateParameters

protected void populateParameters(org.hibernate.Query hquery,
                                  Query query)
Parameters:
hquery - query to populate parameters
query - 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.