@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;
  }
  /**
   * Creates a new tra cuu thu tuc hanh chinh with the primary key. Does not add the tra cuu thu tuc
   * hanh chinh to the database.
   *
   * @param id the primary key for the new tra cuu thu tuc hanh chinh
   * @return the new tra cuu thu tuc hanh chinh
   */
  public TraCuuThuTucHanhChinh create(long id) {
    TraCuuThuTucHanhChinh traCuuThuTucHanhChinh = new TraCuuThuTucHanhChinhImpl();

    traCuuThuTucHanhChinh.setNew(true);
    traCuuThuTucHanhChinh.setPrimaryKey(id);

    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();
  }
  @Override
  public void clearCache(List<TraCuuThuTucHanhChinh> traCuuThuTucHanhChinhs) {
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);

    for (TraCuuThuTucHanhChinh traCuuThuTucHanhChinh : traCuuThuTucHanhChinhs) {
      EntityCacheUtil.removeResult(
          TraCuuThuTucHanhChinhModelImpl.ENTITY_CACHE_ENABLED,
          TraCuuThuTucHanhChinhImpl.class,
          traCuuThuTucHanhChinh.getPrimaryKey());
    }
  }
 /**
  * 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;
  }