javax.jdo.Query.setCandidates()方法的使用及代码示例

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

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

Query.setCandidates介绍

[英]Set the candidate Collection to query.
[中]将候选人Collection设置为查询。

代码示例

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

/**
 * Construct a query instance with the candidate class and candidate
 * Collection specified.
 * @param cls The class to query
 * @param cln The collection
 * @return The query
 * @param <T> Candidate type for the query
 */
public <T> Query<T> newQuery(Class<T> cls, Collection<T> cln)
{
  Query query = newQuery();
  query.setClass(cls);
  query.setCandidates(cln);
  return query;
}

代码示例来源:origin: jpox/jpox

/**
 * Construct a query instance with the candidate class and candidate
 * Collection specified.
 * @param cls The class to query
 * @param cln The collection
 * @return The query
 */
public synchronized Query newQuery(Class cls, Collection cln)
{
  Query query = newQuery();
  query.setClass(cls);
  query.setCandidates(cln);
  return query;
}

代码示例来源:origin: tzaeschke/zoodb

@SuppressWarnings("rawtypes")
@Override
public Query newQuery(Class arg0, Collection arg1, String arg2) {
  DBTracer.logCall(this, arg0, arg1, arg2);
  checkOpen();
  Query q = new QueryImpl(this, arg0, arg2);
  q.setCandidates(arg1);
  return q;
}

代码示例来源:origin: tzaeschke/zoodb

@SuppressWarnings("rawtypes")
@Override
public Query newQuery(Class arg0, Collection arg1) {
  DBTracer.logCall(this, arg0, arg1);
  checkOpen();
  Query q = new QueryImpl(this, arg0, "");
  q.setCandidates(arg1);
  return q;
}

代码示例来源:origin: jpox/jpox

/**
 * Construct a query instance with the candidate Extent specified; the
 * candidate class is taken from the Extent.
 * @param cln The extent to query
 * @return The query
 */
public synchronized Query newQuery(Extent cln)
{
  Query query = newQuery();
  query.setClass(cln.getCandidateClass());
  query.setCandidates(cln);
  return query;
}

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

/**
 * Construct a query instance with the candidate Extent specified; the
 * candidate class is taken from the Extent.
 * @param cln The extent to query
 * @return The query
 * @param <T> Candidate type for the query
 */
public <T> Query<T> newQuery(Extent<T> cln)
{
  Query query = newQuery();
  query.setClass(cln.getCandidateClass());
  query.setCandidates(cln);
  return query;
}

代码示例来源:origin: jpox/jpox

/**
 * Construct a query instance with the candidate class, the candidate
 * Collection, and filter specified.
 * @param cls The class to query
 * @param cln A collection
 * @param filter A filter to apply
 * @return The query
 */
public synchronized Query newQuery(Class cls, Collection cln, String filter)
{
  Query query = newQuery();
  query.setClass(cls);
  query.setCandidates(cln);
  query.setFilter(filter);
  return query;
}

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

/**
 * Construct a query instance with the candidate class, the candidate
 * Collection, and filter specified.
 * @param cls The class to query
 * @param cln A collection
 * @param filter A filter to apply
 * @return The query
 * @param <T> Candidate type for the query
 */
public <T> Query<T> newQuery(Class<T> cls, Collection<T> cln, String filter)
{
  Query query = newQuery();
  query.setClass(cls);
  query.setCandidates(cln);
  query.setFilter(filter);
  return query;
}

代码示例来源:origin: jpox/jpox

/**
 * Construct a query instance with the candidate Extent and filter
 * specified. The candidate class is taken from the Extent.
 * @param cln The extent to query
 * @param filter A filter to apply
 * @return The query
 */
public synchronized Query newQuery(Extent cln, String filter)
{
  Query query = newQuery();
  query.setClass(cln.getCandidateClass());
  query.setCandidates(cln);
  query.setFilter(filter);
  return query;
}

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

/**
 * Construct a query instance with the candidate Extent and filter
 * specified. The candidate class is taken from the Extent.
 * @param cln The extent to query
 * @param filter A filter to apply
 * @return The query
 * @param <T> Candidate type for the query
 */
public <T> Query<T> newQuery(Extent<T> cln, String filter)
{
  Query query = newQuery();
  query.setClass(cln.getCandidateClass());
  query.setCandidates(cln);
  query.setFilter(filter);
  return query;
}

代码示例来源:origin: tzaeschke/zoodb

test.add(tc1);
test.add(tc2);
q.setCandidates(test);
checkQuery(q, 2, tc1, tc2);
checkRemoveFail(q, 2);
q.setCandidates(list);
checkQuery(q, 3, tc1, tc2);
checkRemoveFail(q, 3);

代码示例来源:origin: tzaeschke/zoodb

Query q = pm.newQuery(x1);
Extent<TestClass> x2 = pm.getExtent(TestClass.class);
q.setCandidates(x2);

相关文章