org.datanucleus.store.query.Query.setResult()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.datanucleus.store.query.Query.setResult方法的一些代码示例,展示了Query.setResult的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setResult方法的具体详情如下:
包路径:org.datanucleus.store.query.Query
类名称:Query
方法名:setResult

Query.setResult介绍

暂无

代码示例

代码示例来源:origin: org.datanucleus/datanucleus-api-jdo

/**
 * Set the result for the query.
 * @param result Result clause
 */
public void setResult(String result)
{
  assertIsOpen();
  try
  {
    query.setResult(result);
  }
  catch (NucleusException jpe)
  {
    throw NucleusJDOHelper.getJDOExceptionForNucleusException(jpe);
  }
}

代码示例来源:origin: org.datanucleus/datanucleus-jpa

/**
 * Method to return a query for the specified Criteria Query.
 * @param criteriaQuery The Criteria query
 * @return The JPA query to use
 */
public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery)
{
  CriteriaQueryImpl<T> criteria = (CriteriaQueryImpl<T>)criteriaQuery;
  String jpqlString = criteria.toString();
  TypedQuery<T> query = null;
  QueryCompilation compilation = criteria.getCompilation(om.getMetaDataManager(), om.getClassLoaderResolver());
  if (criteria.getResultType() != null && criteria.getResultType() != compilation.getCandidateClass())
  {
    query = createQuery(jpqlString, criteria.getResultType());
  }
  else
  {
    query = createQuery(jpqlString);
  }
  org.datanucleus.store.query.Query internalQuery = ((JPAQuery)query).getInternalQuery();
  if (compilation.getExprResult() == null)
  {
    // If the result was "Object(e)" or "e" then this is meaningless so remove
    internalQuery.setResult(null);
  }
  internalQuery.setCompilation(compilation);
  return query;
}

相关文章