Package com.baasbox.dao

Examples of com.baasbox.dao.DocumentDao.update()


    DocumentDao dao = DocumentDao.getInstance(collection);
    DbHelper.requestTransaction();

    ODocument doc = dao.create();
    try  {
      dao.update(doc,(ODocument) (new ODocument()).fromJSON(bodyJson.toString()));
      dao.save(doc);
      DbHelper.commitTransaction();
    }catch (OSerializationException e){
      DbHelper.rollbackTransaction();
      throw new InvalidJsonException(e);
View Full Code Here


  public static ODocument update(String collectionName,String rid, JsonNode bodyJson) throws InvalidCollectionException,InvalidModelException, ODatabaseException, IllegalArgumentException, DocumentNotFoundException, UpdateOldVersionException {
    ODocument doc=get(collectionName,rid);
    if (doc==null) throw new InvalidParameterException(rid + " is not a valid document");
    //update the document
    DocumentDao dao = DocumentDao.getInstance(collectionName);
    dao.update(doc,(ODocument) (new ODocument()).fromJSON(bodyJson.toString()));

    return doc;//.toJSON("fetchPlan:*:0 _audit:1,rid");
  }//update


View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.