當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。