Examples of TxnMode


Examples of modelet.entity.TxnMode

  }
 
  @Transactional(readOnly = false)
  public int save(Entity entity) throws ModelException {
   
    TxnMode txnMode = entity.getTxnMode();
    if (txnMode == null)
      throw new ModelException("Please assign action type(insert, update, delete) before persist entity to database.");
   
    int returnCode = 0;
    entity.beforeSave();
    if (txnMode.equals(TxnMode.INSERT))
      returnCode = insert(entity);
    else if (txnMode.equals(TxnMode.UPDATE))
      returnCode = update(entity);
    else if (txnMode.equals(TxnMode.DELETE))
      returnCode = delete(entity);
   
    entity.afterSave();
    return returnCode;
  }
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.