当前位置: 首页>>代码示例>>Java>>正文


Java Query.get方法代码示例

本文整理汇总了Java中org.mongodb.morphia.query.Query.get方法的典型用法代码示例。如果您正苦于以下问题:Java Query.get方法的具体用法?Java Query.get怎么用?Java Query.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mongodb.morphia.query.Query的用法示例。


在下文中一共展示了Query.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getJob

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
@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();
}
 
开发者ID:WenZuHuai,项目名称:light-task-scheduler,代码行数:8,代码来源:MongoExecutingJobQueue.java

示例2: getJob

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
@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();
}
 
开发者ID:WenZuHuai,项目名称:light-task-scheduler,代码行数:9,代码来源:MongoExecutableJobQueue.java

示例3: findById

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
public Author findById(String id) {

		Datastore ds = getDatastore();
		Query<Author> query = ds.createQuery(Author.class).field("_id")
				.equal(id);

		return query.get();
	}
 
开发者ID:machadolucas,项目名称:avanto,代码行数:9,代码来源:AuthorDAO.java

示例4: findByEmail

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
public WebAppUser findByEmail(String email) {
	Datastore ds = getDatastore();
	Query<WebAppUser> query = ds.createQuery(WebAppUser.class)
			.field("email").equal(email);

	return query.get();

}
 
开发者ID:machadolucas,项目名称:avanto,代码行数:9,代码来源:WebAppUserDAO.java

示例5: findIndividualByIdentifier

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
public Post findIndividualByIdentifier(String identifier) {

		Datastore ds = getDatastore();
		Query<Post> query = ds.createQuery(Post.class).field("identificator")
				.equal(identifier);

		return query.get();
	}
 
开发者ID:machadolucas,项目名称:avanto,代码行数:9,代码来源:PostDAO.java

示例6: findById

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
public Parameter findById(String id) {

		Datastore ds = getDatastore();
		Query<Parameter> query = ds.createQuery(Parameter.class).field("_id")
				.equal(id);

		return query.get();
	}
 
开发者ID:machadolucas,项目名称:avanto,代码行数:9,代码来源:ParameterDAO.java

示例7: getDatabyTaskId

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
public TelemetryData getDatabyTaskId(String taskId) {
	Datastore ds = getDataSource();
	Query<TelemetryData> q = ds.find(TelemetryData.class, "taskId", taskId);
	TelemetryData td = null;
	if(q.asList().size() > 0) {
		td = q.get();
	}
	return td;
}
 
开发者ID:eBay,项目名称:ostara,代码行数:10,代码来源:TelemetryDAO.java

示例8: executeQuery

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
@Override
public Object executeQuery(QueryInfo info, Object[] args) {
	
	QueryVisitor visitor = MongoDBVisitorFactory.createQueryVisitor(info, args);
	QueryRepresentation qr = visitor.getQueryRepresentation();
	
	@SuppressWarnings("rawtypes")
	Query q = (Query) qr.getQuery();
	
	if(info.getQueryType() == QueryType.RETRIEVE_SINGLE)
		return q.get();
	else
		return q.asList();
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:15,代码来源:MongoDBQueryExecutor.java

示例9: getBuildBySha

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
public <T extends DbBackedBuild> T getBuildBySha(final DbBackedProject<?, ?> project, final String sha, final Result result) {

        Query<DbBackedBuild> query = getQuery(project).
            field("actions.causes.sha").equal(sha);

        if (result != null) {
            query = query.filter("result", result.toString());
        }
        final DbBackedBuild build = query.get();

        associateProject(project, build);

        return (T) build;
    }
 
开发者ID:groupon,项目名称:DotCi,代码行数:15,代码来源:DynamicBuildRepository.java

示例10: get

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
@Override
public Activity get(ActivityFilter request, String id) {
    Query<MongoActivity> q = q();
    if (request.hasUser()) {
        MongoUser u = (MongoUser) request.getUser();
        if (request.isFriendActivities()) {
            q.field(MongoActivity.USER)
                    .in(userDao.getFriendRefs(u));
        } else {
            q.field(MongoActivity.USER)
                    .equal(key(u));
        }
    }
    if (request.hasGroup()) {
        q.field(MongoActivity.USER)
                .in(groupDao.getMemberRefs(request.getGroup()));
    }
    if (request.hasType()) {
        q.field(MongoActivity.TYPE)
                .equal(request.getType());
    }
    try {
        q.field(MongoActivity.ID).equal(new ObjectId(id));
    } catch (IllegalArgumentException e) {
        return null;
    }
    return q.get();
}
 
开发者ID:enviroCar,项目名称:enviroCar-server,代码行数:29,代码来源:MongoActivityDao.java

示例11: testLoadingOfRefInList

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
@Test
public void testLoadingOfRefInList() throws Exception {
    // TODO us: exclusion does not work properly with maven + junit4
    if (!LazyFeatureDependencies.testDependencyFullFilled()) {
        return;
    }

    getMorphia().map(ContainerWithRefList.class);
    getMorphia().map(OtherEntity.class);

    OtherEntity otherEntity = new OtherEntity();
    ContainerWithRefList containerWithRefInList = new ContainerWithRefList();

    getDs().save(asList(otherEntity, containerWithRefInList));

    otherEntity = getDs().get(otherEntity);
    containerWithRefInList = getDs().get(containerWithRefInList);
    Assert.assertNotNull(otherEntity);
    Assert.assertNotNull(containerWithRefInList);

    final EmbedWithRef embedWithRef = new EmbedWithRef();
    embedWithRef.otherEntity = otherEntity;
    containerWithRefInList.embedWithRef.add(embedWithRef);

    getDs().save(asList(otherEntity, containerWithRefInList));

    containerWithRefInList = getDs().get(containerWithRefInList);
    Assert.assertNotNull(containerWithRefInList);

    final Query<ContainerWithRefList> createQuery = getDs().find(ContainerWithRefList.class);
    containerWithRefInList = createQuery.get();
    Assert.assertNotNull(containerWithRefInList);

}
 
开发者ID:mongodb,项目名称:morphia,代码行数:35,代码来源:LazyInEmbeddedTest.java

示例12: testLoadingOfRefThroughInheritanceInList

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
@Test
public void testLoadingOfRefThroughInheritanceInList() throws Exception {
    // TODO us: exclusion does not work properly with maven + junit4
    if (!LazyFeatureDependencies.testDependencyFullFilled()) {
        return;
    }

    getMorphia().map(ContainerWithRefList.class);
    getMorphia().map(OtherEntityChild.class);

    OtherEntityChild otherEntity = new OtherEntityChild();
    ContainerWithRefList containerWithRefInList = new ContainerWithRefList();

    getDs().save(asList(otherEntity, containerWithRefInList));

    otherEntity = getDs().get(otherEntity);
    final ContainerWithRefList reload = getDs().get(containerWithRefInList);
    Assert.assertNotNull(otherEntity);
    Assert.assertNotNull(reload);

    final EmbedWithRef embedWithRef = new EmbedWithRef();
    embedWithRef.otherEntity = otherEntity;
    reload.embedWithRef.add(embedWithRef);

    getDs().save(asList(otherEntity, reload));

    getDs().get(reload);

    containerWithRefInList = getDs().get(reload);
    Assert.assertNotNull(containerWithRefInList);
    final Query<ContainerWithRefList> createQuery = getDs().find(ContainerWithRefList.class);
    containerWithRefInList = createQuery.get();
    Assert.assertNotNull(containerWithRefInList);

}
 
开发者ID:mongodb,项目名称:morphia,代码行数:36,代码来源:LazyInEmbeddedTest.java

示例13: finish

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
@Override
public JobPo finish(String jobId) {
    Query<JobPo> query = template.createQuery(JobPo.class);
    query.field("jobId").equal(jobId);
    return query.get();
}
 
开发者ID:WenZuHuai,项目名称:light-task-scheduler,代码行数:7,代码来源:MongoCronJobQueue.java

示例14: getJob

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
@Override
public JobPo getJob(String jobId) {
    Query<JobPo> query = template.createQuery(JobPo.class);
    query.field("jobId").equal(jobId);
    return query.get();
}
 
开发者ID:WenZuHuai,项目名称:light-task-scheduler,代码行数:7,代码来源:MongoSuspendJobQueue.java

示例15: update

import org.mongodb.morphia.query.Query; //导入方法依赖的package包/类
public Product update(String id, Product product){
    final UpdateOperations<Product> updateOperations = datastore.createUpdateOperations(Product.class).set("name", product.getName()).set("description", product.getDescription()).set("value", product.getValue());
    final Query<Product> query = datastore.createQuery(Product.class).filter("_id ==", new ObjectId(id));
    datastore.update(query, updateOperations);
    return query.get();
}
 
开发者ID:gabfssilva,项目名称:microservices-sample-undertow-cdi-jaxrs,代码行数:7,代码来源:ProductRepository.java


注:本文中的org.mongodb.morphia.query.Query.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。