Package com.baasbox.dao.exception

Examples of com.baasbox.dao.exception.UpdateOldVersionException


    if (Logger.isTraceEnabled()) Logger.trace("Method End");
  }
 

  public void update(ODocument originalDocument, ODocument documentToMerge) throws UpdateOldVersionException  {
    if (documentToMerge.getVersion()!=0 && documentToMerge.getVersion()!=originalDocument.getVersion()) throw new UpdateOldVersionException("The document to merge is older than the stored one v" +documentToMerge.getVersion() + " vs v"+documentToMerge.getVersion(),documentToMerge.getVersion(), originalDocument.getVersion());
    //backup the baasbox's fields
    HashMap<String,Object> map = backupBaasBoxFields(originalDocument);
    //update the document
    originalDocument.merge(documentToMerge, false, false);
    //restore the baasbox's fields
View Full Code Here


    }catch (OSerializationException e){
      DbHelper.rollbackTransaction();
      throw new InvalidJsonException(e);
    }catch (UpdateOldVersionException e){
      DbHelper.rollbackTransaction();
      throw new UpdateOldVersionException("Are you trying to create a document with a @version field?");
    }
   
    return doc;
  }
View Full Code Here

TOP

Related Classes of com.baasbox.dao.exception.UpdateOldVersionException

Copyright © 2018 www.massapicom. 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.