Subversion Repositories SmartDukaan

Rev

Rev 35390 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35390 Rev 35527
Line 95... Line 95...
95
 
95
 
96
    }
96
    }
97
 
97
 
98
    private static <T> void insertOrUpdateById(DBCollection collection, long id, T obj) {
98
    private static <T> void insertOrUpdateById(DBCollection collection, long id, T obj) {
99
        DBObject dbo = BasicDBObject.parse(gson.toJson(obj));
99
        DBObject dbo = BasicDBObject.parse(gson.toJson(obj));
-
 
100
        LOGGER.info("dbo {}", dbo);
100
        dbo.put("_id", id);
101
        dbo.put("_id", id);
101
        collection.update(new BasicDBObject("_id", id), dbo, true, false);
102
        Object result = collection.update(new BasicDBObject("_id", id), dbo, true, false);
-
 
103
        LOGGER.info("result mongo {}", result);
102
    }
104
    }
103
 
105
 
104
    public JSONObject getItemsByBundleId(long bundleId) throws Exception {
106
    public JSONObject getItemsByBundleId(long bundleId) throws Exception {
105
        DB db = mongoClient.getDB(CATALOG_DB);
107
        DB db = mongoClient.getDB(CATALOG_DB);
106
        DBCollection collection = db.getCollection(MASTER_DATA);
108
        DBCollection collection = db.getCollection(MASTER_DATA);