@Component @Named(value="hql") @Singleton public class HqlQueryExecutor extends Object implements QueryExecutor, org.xwiki.component.phase.Initializable
Constructor and Description |
---|
HqlQueryExecutor() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkAllowed(Query query) |
protected String |
completeShortFormStatement(String statement)
Append the required select clause to HQL short query statements.
|
protected <T> org.hibernate.query.Query<T> |
createHibernateQuery(org.hibernate.Session session,
Query query) |
<T> List<T> |
execute(Query query) |
protected XWikiContext |
getContext() |
protected XWikiHibernateStore |
getStore() |
void |
initialize() |
protected static boolean |
isSafeSelect(String statementString) |
protected void |
populateParameters(org.hibernate.query.Query<?> hquery,
Query query) |
protected void |
setNamedParameter(org.hibernate.query.Query<?> query,
String name,
Object value)
Sets the value of the specified named parameter, taking into account the type of the given value.
|
public void initialize() throws org.xwiki.component.phase.InitializationException
initialize
in interface org.xwiki.component.phase.Initializable
org.xwiki.component.phase.InitializationException
protected static boolean isSafeSelect(String statementString)
statementString
- the statement to evaluateprotected void checkAllowed(Query query) throws QueryException
QueryException
public <T> List<T> execute(Query query) throws QueryException
execute
in interface QueryExecutor
QueryException
protected <T> org.hibernate.query.Query<T> createHibernateQuery(org.hibernate.Session session, Query query)
protected String completeShortFormStatement(String statement)
, BaseObject obj where doc.fullName=obj.name and obj.className='XWiki.MyClass'
where doc.creationDate > '2008-01-01'
statement
- the statement to complete if required.protected void populateParameters(org.hibernate.query.Query<?> hquery, Query query)
hquery
- query to populate parametersquery
- query from to populate.protected void setNamedParameter(org.hibernate.query.Query<?> query, String name, Object value)
query
- the query to set the parameter forname
- the parameter namevalue
- the non-null parameter valueprotected XWikiHibernateStore getStore()
protected XWikiContext getContext()
Copyright © 2004–2021 XWiki. All rights reserved.