org.mongodb.morphia.query.Query.field()方法的使用及代码示例

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

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

Query.field介绍

[英]Fluent query interface: createQuery(Ent.class).field("count").greaterThan(7)...
[中]流畅的查询接口:createQuery(Ent.class)。字段(“计数”)。比(7)。。。

代码示例

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public JobPo getJob(String taskTrackerNodeGroup, String taskId) {
  Query<JobPo> query = template.createQuery(JobPo.class);
  query.field("taskId").equal(taskId).
      field("taskTrackerNodeGroup").equal(taskTrackerNodeGroup);
  return query.get();
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public void removeNodeGroup(NodeType nodeType, String name) {
  Query<NodeGroupPo> query = template.createQuery(NodeGroupPo.class);
  query.field("nodeType").equal(nodeType).field("name").equal(name);
  template.delete(query);
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
  public JobPo getJob(String taskTrackerNodeGroup, String taskId) {
    String tableName = JobQueueUtils.getExecutableQueueName(taskTrackerNodeGroup);
    Query<JobPo> query = template.createQuery(tableName, JobPo.class);
    query.field("taskId").equal(taskId).
        field("taskTrackerNodeGroup").equal(taskTrackerNodeGroup);
    return query.get();
  }
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public boolean removeBatch(String realTaskId, String taskTrackerNodeGroup) {
  String tableName = JobQueueUtils.getExecutableQueueName(taskTrackerNodeGroup);
  Query<JobPo> query = template.createQuery(tableName, JobPo.class);
  query.field("realTaskId").equal(realTaskId);
  query.field("taskTrackerNodeGroup").equal(taskTrackerNodeGroup);
  template.delete(query);
  return true;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public JobPo getJob(String taskTrackerNodeGroup, String taskId) {
  String tableName = JobQueueUtils.getExecutableQueueName(taskTrackerNodeGroup);
  Query<JobPo> query = template.createQuery(tableName, JobPo.class);
  query.field("taskId").equal(taskId).
      field("taskTrackerNodeGroup").equal(taskTrackerNodeGroup);
  return query.get();
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
protected JobPo getJob(String taskTrackerNodeGroup, String jobId) {
  String tableName = JobQueueUtils.getExecutableQueueName(taskTrackerNodeGroup);
  Query<JobPo> query = template.createQuery(tableName, JobPo.class);
  query.field("jobId").equal(jobId).
      field("taskTrackerNodeGroup").equal(taskTrackerNodeGroup);
  return query.get();
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public JobPo getJob(String jobId) {
  Query<JobPo> query = template.createQuery(JobPo.class);
  query.field("jobId").equal(jobId);
  return query.get();
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public JobPo getJob(String jobId) {
  Query<JobPo> query = template.createQuery(JobPo.class);
  query.field("jobId").equal(jobId);
  return query.get();
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
  public List<JobPo> getNeedGenerateJobPos(Long checkTime, int topSize) {
    Query<JobPo> query = template.createQuery(JobPo.class);
    query.field("relyOnPrevCycle").equal(false);
    query.field("lastGenerateTriggerTime").equal(checkTime);
    query.offset(0).limit(topSize);
    return query.asList();
  }
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public JobPo getJob(String jobId) {
  Query<JobPo> query = template.createQuery(JobPo.class);
  query.field("jobId").equal(jobId);
  return query.get();
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public JobPo getJob(String jobId) {
  Query<JobPo> query = template.createQuery(JobPo.class);
  query.field("jobId").equal(jobId);
  return query.get();
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public boolean remove(String jobId) {
  Query<JobPo> query = template.createQuery(JobPo.class);
  query.field("jobId").equal(jobId);
  WriteResult wr = template.delete(query);
  return wr.getN() == 1;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public boolean remove(String jobId) {
  Query<JobPo> query = template.createQuery(JobPo.class);
  query.field("jobId").equal(jobId);
  WriteResult wr = template.delete(query);
  return wr.getN() == 1;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public boolean remove(String jobId) {
  Query<JobPo> query = template.createQuery(JobPo.class);
  query.field("jobId").equal(jobId);
  WriteResult wr = template.delete(query);
  return wr.getN() == 1;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public boolean remove(String jobClientNodeGroup, String id) {
  Query<JobFeedbackPo> query = createQuery(jobClientNodeGroup);
  query.field("id").equal(id);
  WriteResult wr = template.delete(query);
  return wr.getN() == 1;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public boolean remove(String jobId) {
  Query<JobPo> query = template.createQuery(JobPo.class);
  query.field("jobId").equal(jobId);
  WriteResult wr = template.delete(query);
  return wr.getN() == 1;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public List<JobPo> getDeadJob(String taskTrackerNodeGroup, long deadline) {
  String tableName = JobQueueUtils.getExecutableQueueName(taskTrackerNodeGroup);
  Query<JobPo> query = template.createQuery(tableName, JobPo.class);
  query.field("isRunning").equal(true).
      filter("gmtCreated < ", deadline);
  return query.asList();
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public boolean selectiveUpdateByTaskId(JobQueueReq request) {
  Assert.hasLength(request.getRealTaskId(), "Only allow update by realTaskId and taskTrackerNodeGroup");
  Assert.hasLength(request.getTaskTrackerNodeGroup(), "Only allow update by realTaskId and taskTrackerNodeGroup");
  Query<JobPo> query = template.createQuery(getTargetTable(request.getTaskTrackerNodeGroup()), JobPo.class);
  query.field("realTaskId").equal(request.getRealTaskId());
  query.field("taskTrackerNodeGroup").equal(request.getTaskTrackerNodeGroup());
  UpdateOperations<JobPo> operations = buildUpdateOperations(request);
  UpdateResults ur = template.update(query, operations);
  return ur.getUpdatedCount() == 1;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public boolean selectiveUpdateByJobId(JobQueueReq request) {
  Assert.hasLength(request.getJobId(), "Only allow update by jobId");
  Query<JobPo> query = template.createQuery(getTargetTable(request.getTaskTrackerNodeGroup()), JobPo.class);
  query.field("jobId").equal(request.getJobId());
  UpdateOperations<JobPo> operations = buildUpdateOperations(request);
  UpdateResults ur = template.update(query, operations);
  return ur.getUpdatedCount() == 1;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

public void resume(JobPo jobPo) {
  String tableName = JobQueueUtils.getExecutableQueueName(jobPo.getTaskTrackerNodeGroup());
  Query<JobPo> query = template.createQuery(tableName, JobPo.class);
  query.field("jobId").equal(jobPo.getJobId());
  UpdateOperations<JobPo> operations =
      template.createUpdateOperations(JobPo.class)
          .set("isRunning", false)
          .set("taskTrackerIdentity", "")
          .set("gmtModified", SystemClock.now());
  template.update(query, operations);
}

相关文章