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


Java Update.getUpdateObject方法代码示例

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


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

示例1: buildPullObject

import org.springframework.data.mongodb.core.query.Update; //导入方法依赖的package包/类
private DBObject buildPullObject(List<Entity> subEntities) {
    Set<String> existingIds = new HashSet<String>(getSubDocDids(subEntities));
    Query pullQuery = new Query(Criteria.where("_id").in(existingIds));
    Update update = new Update();
    update.pull(subField, pullQuery.getQueryObject());
    return update.getUpdateObject();
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:8,代码来源:SubDocAccessor.java

示例2: buildPushObject

import org.springframework.data.mongodb.core.query.Update; //导入方法依赖的package包/类
private DBObject buildPushObject(List<Entity> subEntities) {
    List<DBObject> subDocs = new ArrayList<DBObject>();
    for (Entity entity : subEntities) {
        subDocs.add(subDocToDBObject(entity));
    }
    Update update = new Update();
    update.set("type", collection).pushAll(subField, subDocs.toArray());
    return update.getUpdateObject();
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:10,代码来源:SubDocAccessor.java

示例3: buildPushObject

import org.springframework.data.mongodb.core.query.Update; //导入方法依赖的package包/类
private DBObject buildPushObject(List<Entity> entities) {
    List<DBObject> docs = new ArrayList<DBObject>();
    for (Entity entity : entities) {
        docs.add(getDbObject(entity));
    }

    Update update = new Update();
    update.set("type", denormalizeToEntity).pushAll(denormalizedToField, docs.toArray());

    return update.getUpdateObject();
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:12,代码来源:Denormalizer.java

示例4: buildPullObject

import org.springframework.data.mongodb.core.query.Update; //导入方法依赖的package包/类
private DBObject buildPullObject(List<Entity> entities) {
    Query pullQuery = new Query();

    List <Criteria> orList = new ArrayList<Criteria>();
    for (Entity entity : entities) {
        String internalId = null;
        if (denormalizedIdKey.equals("_id")) {
            internalId = entity.getEntityId();
        } else {
            internalId = (String) entity.getBody().get(denormalizedIdKey);
        }
        //delete studentSectionAssociation DND where (sectionId(_id) = "x1" and beginDate(denormalizedKey) = "y1") OR (sectionId(_id) = "x2" and beginDate(denormalizedKey) = "y2") ...
        //delete studentSchoolAssociation  DND where (schoolld(_id)  = "x1" and entryDate(denormalizedKey) = "y1") OR (schoolld(_id)  = "x2" and entryDate(denormalizedKey) = "y2") ...
        //DND -> denormalizedDoc
        List<Criteria> andList = new ArrayList<Criteria>();
        andList.add(Criteria.where("_id").is(internalId));
        for(String denormalizedKey:denormalizedEntityKeys) {
            String denormalizedValue = (String) entity.getBody().get(denormalizedKey);
            andList.add( Criteria.where(denormalizedKey).is(denormalizedValue));
        }
            Criteria and = new Criteria().andOperator(andList.toArray(new Criteria[0]));
            orList.add(and);
    }
    Criteria or = new Criteria().orOperator(orList.toArray(new Criteria[0]));
    pullQuery.addCriteria(or);

    Update update = new Update();
    update.pull(denormalizedToField, pullQuery.getQueryObject());

    return update.getUpdateObject();
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:32,代码来源:Denormalizer.java


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