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

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

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

Query.setUnique介绍

暂无

代码示例

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

/**
 * Set whether to expect a unique result.
 * @param unique Whether results are unique
 */
public void setUnique(boolean unique)
{
  assertIsOpen();
  try
  {
    query.setUnique(unique);
  }
  catch (NucleusException jpe)
  {
    throw NucleusJDOHelper.getJDOExceptionForNucleusException(jpe);
  }
}

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

@Override
public <R> R executeResultUnique(Class<R> resultCls)
{
  assertIsOpen();
  query.setUnique(true);
  if (resultCls == null)
  {
    throw new JDOUserException("Result Class must be specified");
  }
  this.query.setResultClass(resultCls);
  return (R) executeInternal();
}

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

@Override
public Object executeResultUnique()
{
  assertIsOpen();
  query.setUnique(true);
  if (query.getResult() == null)
  {
    throw new JDOUserException("Cannot call executeResultUnique method when query has result unset. Call executeUnique instead.");
  }
  return executeInternal();
}

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

query.setUnique(true);
return query.executeWithMap(null); // Params defined using setParameter() earlier

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

@Override
public T executeUnique()
{
  assertIsOpen();
  query.setUnique(true);
  if (query.getResult() != null)
  {
    throw new JDOUserException("Cannot call executeXXX method when query has result set to " + query.getResult() + ". Use executeResultUnique() instead");
  }
  return (T) executeInternal();
}

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

query.setUnique(true);

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

internalQuery.setUnique(unique);
if (candidates != null)

相关文章