@Override
  public final T process(final Map<String, Object> pReqVars,
    final T pEntity, final IRequestData pRequestData) throws Exception {
    SeSeller ses = findSeSeller.find(pReqVars, pRequestData.getUserName());
    pEntity.setSeller(ses);
    if (pEntity.getIsNew()) {
      this.srvOrm.insertEntity(pReqVars, pEntity);
      pEntity.setIsNew(false);
    } else {
      T entOld = this.srvOrm.retrieveEntity(pReqVars, pEntity);
      if (!entOld.getSeller().getItsId().getItsId()
        .equals(pEntity.getSeller().getItsId().getItsId())) {
        throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN,
        "Attempt to update smb. else's entity: user/entity/EID/SEOLDID/SEID - "
          + pRequestData.getUserName() + "/" + pEntity.getClass()
           .getSimpleName() + "/" + pEntity.getItsId() + "/" + entOld
            .getSeller().getItsId().getItsId() + "/" + pEntity.getSeller()
              .getItsId().getItsId());
      }
      this.srvOrm.updateEntity(pReqVars, pEntity);
    }
    return pEntity;
  }
@ Override public final T process ( final Map < String , Object > pReqVars , final T pEntity , final IRequestData pRequestData ) throws Exception { SeSeller ses = findSeSeller . find ( pReqVars , pRequestData . getUserName ( ) ) ; pEntity . setSeller ( ses ) ; if ( pEntity . getIsNew ( ) ) { this . srvOrm . insertEntity ( pReqVars , pEntity ) ; pEntity . setIsNew ( false ) ; } else { T entOld = this . srvOrm . retrieveEntity ( pReqVars , pEntity ) ; if ( ! entOld . getSeller ( ) . getItsId ( ) . getItsId ( ) . equals ( pEntity . getSeller ( ) . getItsId ( ) . getItsId ( ) ) ) { throw new ExceptionWithCode ( ExceptionWithCode . FORBIDDEN , "Attempt to update smb. else's entity: user/entity/EID/SEOLDID/SEID - " + pRequestData . getUserName ( ) + "/" + pEntity . getClass ( ) . getSimpleName ( ) + "/" + pEntity . getItsId ( ) + "/" + entOld . getSeller ( ) . getItsId ( ) . getItsId ( ) + "/" + pEntity . getSeller ( ) . getItsId ( ) . getItsId ( ) ) ; } this . srvOrm . updateEntity ( pReqVars , pEntity ) ; } return pEntity ; }
<p>Process entity request.</p>
@param pReqVars additional request scoped parameters
@param pRequestData Request Data
@param pEntity Entity to process
@return Entity processed for farther process or null
@throws Exception - an exception