public ProGateMenuView updateImpl(
      larion.progate.model.ProGateMenuView proGateMenuView, boolean merge) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.update(session, proGateMenuView, merge);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    EntityCacheUtil.putResult(
        ProGateMenuViewModelImpl.ENTITY_CACHE_ENABLED,
        ProGateMenuViewImpl.class,
        proGateMenuView.getPrimaryKey(),
        proGateMenuView);

    return proGateMenuView;
  }
  protected ProGateMenuView removeImpl(ProGateMenuView proGateMenuView) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      if (proGateMenuView.isCachedModel() || BatchSessionUtil.isEnabled()) {
        Object staleObject =
            session.get(ProGateMenuViewImpl.class, proGateMenuView.getPrimaryKeyObj());

        if (staleObject != null) {
          session.evict(staleObject);
        }
      }

      session.delete(proGateMenuView);

      session.flush();
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    EntityCacheUtil.removeResult(
        ProGateMenuViewModelImpl.ENTITY_CACHE_ENABLED,
        ProGateMenuViewImpl.class,
        proGateMenuView.getPrimaryKey());

    return proGateMenuView;
  }
  public ProGateMenuView create(String name) {
    ProGateMenuView proGateMenuView = new ProGateMenuViewImpl();

    proGateMenuView.setNew(true);
    proGateMenuView.setPrimaryKey(name);

    return proGateMenuView;
  }
 public void cacheResult(List<ProGateMenuView> proGateMenuViews) {
   for (ProGateMenuView proGateMenuView : proGateMenuViews) {
     if (EntityCacheUtil.getResult(
             ProGateMenuViewModelImpl.ENTITY_CACHE_ENABLED,
             ProGateMenuViewImpl.class,
             proGateMenuView.getPrimaryKey(),
             this)
         == null) {
       cacheResult(proGateMenuView);
     }
   }
 }
 public void cacheResult(ProGateMenuView proGateMenuView) {
   EntityCacheUtil.putResult(
       ProGateMenuViewModelImpl.ENTITY_CACHE_ENABLED,
       ProGateMenuViewImpl.class,
       proGateMenuView.getPrimaryKey(),
       proGateMenuView);
 }
  public ProGateMenuView update(ProGateMenuView proGateMenuView, boolean merge)
      throws SystemException {
    boolean isNew = proGateMenuView.isNew();

    for (ModelListener<ProGateMenuView> listener : listeners) {
      if (isNew) {
        listener.onBeforeCreate(proGateMenuView);
      } else {
        listener.onBeforeUpdate(proGateMenuView);
      }
    }

    proGateMenuView = updateImpl(proGateMenuView, merge);

    for (ModelListener<ProGateMenuView> listener : listeners) {
      if (isNew) {
        listener.onAfterCreate(proGateMenuView);
      } else {
        listener.onAfterUpdate(proGateMenuView);
      }
    }

    return proGateMenuView;
  }