@Override
  public TraCuuThuTucHanhChinh updateImpl(
      org.oep.cmon.dao.touchscreen.model.TraCuuThuTucHanhChinh traCuuThuTucHanhChinh, boolean merge)
      throws SystemException {
    traCuuThuTucHanhChinh = toUnwrappedModel(traCuuThuTucHanhChinh);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.update(session, traCuuThuTucHanhChinh, merge);

      traCuuThuTucHanhChinh.setNew(false);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    EntityCacheUtil.putResult(
        TraCuuThuTucHanhChinhModelImpl.ENTITY_CACHE_ENABLED,
        TraCuuThuTucHanhChinhImpl.class,
        traCuuThuTucHanhChinh.getPrimaryKey(),
        traCuuThuTucHanhChinh);

    return traCuuThuTucHanhChinh;
  }
  /**
   * Caches the tra cuu thu tuc hanh chinh in the entity cache if it is enabled.
   *
   * @param traCuuThuTucHanhChinh the tra cuu thu tuc hanh chinh
   */
  public void cacheResult(TraCuuThuTucHanhChinh traCuuThuTucHanhChinh) {
    EntityCacheUtil.putResult(
        TraCuuThuTucHanhChinhModelImpl.ENTITY_CACHE_ENABLED,
        TraCuuThuTucHanhChinhImpl.class,
        traCuuThuTucHanhChinh.getPrimaryKey(),
        traCuuThuTucHanhChinh);

    traCuuThuTucHanhChinh.resetOriginalValues();
  }
  /**
   * Clears the cache for the tra cuu thu tuc hanh chinh.
   *
   * <p>The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link
   * com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
   */
  @Override
  public void clearCache(TraCuuThuTucHanhChinh traCuuThuTucHanhChinh) {
    EntityCacheUtil.removeResult(
        TraCuuThuTucHanhChinhModelImpl.ENTITY_CACHE_ENABLED,
        TraCuuThuTucHanhChinhImpl.class,
        traCuuThuTucHanhChinh.getPrimaryKey());

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
  }
 /**
  * Caches the tra cuu thu tuc hanh chinhs in the entity cache if it is enabled.
  *
  * @param traCuuThuTucHanhChinhs the tra cuu thu tuc hanh chinhs
  */
 public void cacheResult(List<TraCuuThuTucHanhChinh> traCuuThuTucHanhChinhs) {
   for (TraCuuThuTucHanhChinh traCuuThuTucHanhChinh : traCuuThuTucHanhChinhs) {
     if (EntityCacheUtil.getResult(
             TraCuuThuTucHanhChinhModelImpl.ENTITY_CACHE_ENABLED,
             TraCuuThuTucHanhChinhImpl.class,
             traCuuThuTucHanhChinh.getPrimaryKey())
         == null) {
       cacheResult(traCuuThuTucHanhChinh);
     } else {
       traCuuThuTucHanhChinh.resetOriginalValues();
     }
   }
 }
  protected TraCuuThuTucHanhChinh toUnwrappedModel(TraCuuThuTucHanhChinh traCuuThuTucHanhChinh) {
    if (traCuuThuTucHanhChinh instanceof TraCuuThuTucHanhChinhImpl) {
      return traCuuThuTucHanhChinh;
    }

    TraCuuThuTucHanhChinhImpl traCuuThuTucHanhChinhImpl = new TraCuuThuTucHanhChinhImpl();

    traCuuThuTucHanhChinhImpl.setNew(traCuuThuTucHanhChinh.isNew());
    traCuuThuTucHanhChinhImpl.setPrimaryKey(traCuuThuTucHanhChinh.getPrimaryKey());

    traCuuThuTucHanhChinhImpl.setId(traCuuThuTucHanhChinh.getId());
    traCuuThuTucHanhChinhImpl.setMa(traCuuThuTucHanhChinh.getMa());
    traCuuThuTucHanhChinhImpl.setTen(traCuuThuTucHanhChinh.getTen());
    traCuuThuTucHanhChinhImpl.setSoNgayXuLy(traCuuThuTucHanhChinh.getSoNgayXuLy());
    traCuuThuTucHanhChinhImpl.setNgayTao(traCuuThuTucHanhChinh.getNgayTao());
    traCuuThuTucHanhChinhImpl.setNgaySua(traCuuThuTucHanhChinh.getNgaySua());
    traCuuThuTucHanhChinhImpl.setDaXoa(traCuuThuTucHanhChinh.getDaXoa());
    traCuuThuTucHanhChinhImpl.setNguoiTao(traCuuThuTucHanhChinh.getNguoiTao());
    traCuuThuTucHanhChinhImpl.setNguoiSua(traCuuThuTucHanhChinh.getNguoiSua());
    traCuuThuTucHanhChinhImpl.setNhomThuTucHanhChinhId(
        traCuuThuTucHanhChinh.getNhomThuTucHanhChinhId());
    traCuuThuTucHanhChinhImpl.setNhomThuTucHanhChinhTen(
        traCuuThuTucHanhChinh.getNhomThuTucHanhChinhTen());
    traCuuThuTucHanhChinhImpl.setTrangThai(traCuuThuTucHanhChinh.getTrangThai());
    traCuuThuTucHanhChinhImpl.setPhienBan(traCuuThuTucHanhChinh.getPhienBan());
    traCuuThuTucHanhChinhImpl.setCanTichHop(traCuuThuTucHanhChinh.getCanTichHop());
    traCuuThuTucHanhChinhImpl.setTrinhTuThucHien(traCuuThuTucHanhChinh.getTrinhTuThucHien());
    traCuuThuTucHanhChinhImpl.setCachThucHien(traCuuThuTucHanhChinh.getCachThucHien());
    traCuuThuTucHanhChinhImpl.setThanhPhanHoSo(traCuuThuTucHanhChinh.getThanhPhanHoSo());
    traCuuThuTucHanhChinhImpl.setLePhi(traCuuThuTucHanhChinh.getLePhi());
    traCuuThuTucHanhChinhImpl.setDonViLePhi(traCuuThuTucHanhChinh.getDonViLePhi());
    traCuuThuTucHanhChinhImpl.setPhi(traCuuThuTucHanhChinh.getPhi());
    traCuuThuTucHanhChinhImpl.setDonViPhi(traCuuThuTucHanhChinh.getDonViPhi());
    traCuuThuTucHanhChinhImpl.setTenMauDonToKhai(traCuuThuTucHanhChinh.getTenMauDonToKhai());
    traCuuThuTucHanhChinhImpl.setYeuCauDieuKienThucHien(
        traCuuThuTucHanhChinh.getYeuCauDieuKienThucHien());
    traCuuThuTucHanhChinhImpl.setCanCuPhapLy(traCuuThuTucHanhChinh.getCanCuPhapLy());
    traCuuThuTucHanhChinhImpl.setCapCoQuanQuanLyId(traCuuThuTucHanhChinh.getCapCoQuanQuanLyId());
    traCuuThuTucHanhChinhImpl.setLinhVucThucHien(traCuuThuTucHanhChinh.getLinhVucThucHien());
    traCuuThuTucHanhChinhImpl.setMaDNG(traCuuThuTucHanhChinh.getMaDNG());
    traCuuThuTucHanhChinhImpl.setUengineProcessName(traCuuThuTucHanhChinh.getUengineProcessName());
    traCuuThuTucHanhChinhImpl.setThuTucLienThongId(traCuuThuTucHanhChinh.getThuTucLienThongId());

    return traCuuThuTucHanhChinhImpl;
  }