本文整理了Java中org.xwiki.query.Query.isNamed
方法的一些代码示例,展示了Query.isNamed
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.isNamed
方法的具体详情如下:
包路径:org.xwiki.query.Query
类名称:Query
方法名:isNamed
[英]if the query is named, then #getStatement() returns a name of the query, else - a query statement.
[中]如果查询已命名,则#getStatement()返回查询的名称,否则返回查询语句。
代码示例来源:origin: org.xwiki.platform/xwiki-platform-query-manager
@Override
public boolean isNamed()
{
return this.query.isNamed();
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-query-manager
@Override
public boolean isNamed()
{
return getWrappedQuery().isNamed();
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-query-manager
@Override
public String getMessage()
{
if (query == null) {
return super.getMessage();
} else {
if (query.isNamed()) {
return super.getMessage() + ". Named query = [" + query.getStatement() + "]";
} else {
return super.getMessage() + ". Query statement = [" + query.getStatement() + "]";
}
}
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* @param session hibernate session
* @param query Query object
* @return hibernate query
*/
protected org.hibernate.Query createHibernateQuery(Session session, Query query)
{
return query.isNamed()
? session.getNamedQuery(query.getStatement())
: session.createQuery(query.getStatement());
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-query-manager
@Override
public <T> List<T> execute(Query query) throws QueryException
{
if (query.isNamed()) {
return this.namedQueryExecutorProvider.get().execute(query);
} else {
try {
return this.componentManagerProvider.get()
.<QueryExecutor>getInstance(QueryExecutor.class, query.getLanguage()).execute(query);
} catch (ComponentLookupException e) {
throw new QueryException("Fail to lookup query executor", query, e);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!