@Override
  protected ExpandoRow removeImpl(ExpandoRow expandoRow) throws SystemException {
    expandoRow = toUnwrappedModel(expandoRow);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, expandoRow);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    ExpandoRowModelImpl expandoRowModelImpl = (ExpandoRowModelImpl) expandoRow;

    FinderCacheUtil.removeResult(
        FINDER_PATH_FETCH_BY_T_C,
        new Object[] {
          Long.valueOf(expandoRowModelImpl.getTableId()),
          Long.valueOf(expandoRowModelImpl.getClassPK())
        });

    EntityCacheUtil.removeResult(
        ExpandoRowModelImpl.ENTITY_CACHE_ENABLED, ExpandoRowImpl.class, expandoRow.getPrimaryKey());

    return expandoRow;
  }
  /**
   * Clears the cache for the asset.
   *
   * <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(Asset asset) {
    EntityCacheUtil.removeResult(
        AssetModelImpl.ENTITY_CACHE_ENABLED, AssetImpl.class, asset.getPrimaryKey());

    FinderCacheUtil.removeResult(FINDER_PATH_FIND_ALL, FINDER_ARGS_EMPTY);
  }
 /**
  * Clears the cache for the social equity history.
  *
  * <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(SocialEquityHistory socialEquityHistory) {
   EntityCacheUtil.removeResult(
       SocialEquityHistoryModelImpl.ENTITY_CACHE_ENABLED,
       SocialEquityHistoryImpl.class,
       socialEquityHistory.getPrimaryKey());
 }
  @Override
  protected JIRAChangeItem removeImpl(JIRAChangeItem jiraChangeItem) throws SystemException {
    jiraChangeItem = toUnwrappedModel(jiraChangeItem);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, jiraChangeItem);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    FinderCacheUtil.removeResult(FINDER_PATH_FIND_ALL, FINDER_ARGS_EMPTY);

    EntityCacheUtil.removeResult(
        JIRAChangeItemModelImpl.ENTITY_CACHE_ENABLED,
        JIRAChangeItemImpl.class,
        jiraChangeItem.getPrimaryKey());

    return jiraChangeItem;
  }
  protected ViewListTitleCompetencies removeImpl(
      ViewListTitleCompetencies viewListTitleCompetencies) throws SystemException {
    Session session = null;

    try {
      session = openSession();

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

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

      session.delete(viewListTitleCompetencies);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    EntityCacheUtil.removeResult(
        ViewListTitleCompetenciesModelImpl.ENTITY_CACHE_ENABLED,
        ViewListTitleCompetenciesImpl.class,
        viewListTitleCompetencies.getPrimaryKey());

    return viewListTitleCompetencies;
  }
  @Override
  protected Ticket removeImpl(Ticket ticket) throws SystemException {
    ticket = toUnwrappedModel(ticket);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, ticket);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    TicketModelImpl ticketModelImpl = (TicketModelImpl) ticket;

    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_KEY, new Object[] {ticketModelImpl.getKey()});

    EntityCacheUtil.removeResult(
        TicketModelImpl.ENTITY_CACHE_ENABLED, TicketImpl.class, ticket.getPrimaryKey());

    return ticket;
  }
  /**
   * Returns the bar with the primary key or returns <code>null</code> if it could not be found.
   *
   * @param primaryKey the primary key of the bar
   * @return the bar, or <code>null</code> if a bar with the primary key could not be found
   */
  @Override
  public Bar fetchByPrimaryKey(Serializable primaryKey) {
    Bar bar =
        (Bar)
            EntityCacheUtil.getResult(BarModelImpl.ENTITY_CACHE_ENABLED, BarImpl.class, primaryKey);

    if (bar == _nullBar) {
      return null;
    }

    if (bar == null) {
      Session session = null;

      try {
        session = openSession();

        bar = (Bar) session.get(BarImpl.class, primaryKey);

        if (bar != null) {
          cacheResult(bar);
        } else {
          EntityCacheUtil.putResult(
              BarModelImpl.ENTITY_CACHE_ENABLED, BarImpl.class, primaryKey, _nullBar);
        }
      } catch (Exception e) {
        EntityCacheUtil.removeResult(BarModelImpl.ENTITY_CACHE_ENABLED, BarImpl.class, primaryKey);

        throw processException(e);
      } finally {
        closeSession(session);
      }
    }

    return bar;
  }
 /**
  * Clears the cache for the h r user time off.
  *
  * <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(HRUserTimeOff hrUserTimeOff) {
   EntityCacheUtil.removeResult(
       HRUserTimeOffModelImpl.ENTITY_CACHE_ENABLED,
       HRUserTimeOffImpl.class,
       hrUserTimeOff.getPrimaryKey());
 }
  @Override
  protected HRUserTimeOff removeImpl(HRUserTimeOff hrUserTimeOff) throws SystemException {
    hrUserTimeOff = toUnwrappedModel(hrUserTimeOff);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, hrUserTimeOff);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    EntityCacheUtil.removeResult(
        HRUserTimeOffModelImpl.ENTITY_CACHE_ENABLED,
        HRUserTimeOffImpl.class,
        hrUserTimeOff.getPrimaryKey());

    return hrUserTimeOff;
  }
  @Override
  protected HROffice removeImpl(HROffice hrOffice) throws SystemException {
    hrOffice = toUnwrappedModel(hrOffice);

    try {
      clearHRHolidaies.clear(hrOffice.getPrimaryKey());
    } catch (Exception e) {
      throw processException(e);
    } finally {
      FinderCacheUtil.clearCache(HROfficeModelImpl.MAPPING_TABLE_HRHOLIDAYS_HROFFICES_NAME);
    }

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, hrOffice);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    EntityCacheUtil.removeResult(
        HROfficeModelImpl.ENTITY_CACHE_ENABLED, HROfficeImpl.class, hrOffice.getPrimaryKey());

    return hrOffice;
  }
  protected DebateItemReference removeImpl(DebateItemReference debateItemReference)
      throws SystemException {
    Session session = null;

    try {
      session = openSession();

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

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

      session.delete(debateItemReference);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    EntityCacheUtil.removeResult(
        DebateItemReferenceModelImpl.ENTITY_CACHE_ENABLED,
        DebateItemReferenceImpl.class,
        debateItemReference.getPrimaryKey());

    return debateItemReference;
  }
  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;
  }
  @Override
  protected LayoutSet removeImpl(LayoutSet layoutSet) throws SystemException {
    layoutSet = toUnwrappedModel(layoutSet);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, layoutSet);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    LayoutSetModelImpl layoutSetModelImpl = (LayoutSetModelImpl) layoutSet;

    FinderCacheUtil.removeResult(
        FINDER_PATH_FETCH_BY_G_P,
        new Object[] {
          Long.valueOf(layoutSetModelImpl.getGroupId()),
          Boolean.valueOf(layoutSetModelImpl.getPrivateLayout())
        });

    EntityCacheUtil.removeResult(
        LayoutSetModelImpl.ENTITY_CACHE_ENABLED, LayoutSetImpl.class, layoutSet.getPrimaryKey());

    return layoutSet;
  }
  /**
   * Returns the foo with the primary key or returns <code>null</code> if it could not be found.
   *
   * @param primaryKey the primary key of the foo
   * @return the foo, or <code>null</code> if a foo with the primary key could not be found
   */
  @Override
  public Foo fetchByPrimaryKey(Serializable primaryKey) {
    Foo foo =
        (Foo)
            EntityCacheUtil.getResult(FooModelImpl.ENTITY_CACHE_ENABLED, FooImpl.class, primaryKey);

    if (foo == _nullFoo) {
      return null;
    }

    if (foo == null) {
      Session session = null;

      try {
        session = openSession();

        foo = (Foo) session.get(FooImpl.class, primaryKey);

        if (foo != null) {
          cacheResult(foo);
        } else {
          EntityCacheUtil.putResult(
              FooModelImpl.ENTITY_CACHE_ENABLED, FooImpl.class, primaryKey, _nullFoo);
        }
      } catch (Exception e) {
        EntityCacheUtil.removeResult(FooModelImpl.ENTITY_CACHE_ENABLED, FooImpl.class, primaryKey);

        throw processException(e);
      } finally {
        closeSession(session);
      }
    }

    return foo;
  }
  /**
   * Clears the cache for the h r project.
   *
   * <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(HRProject hrProject) {
    EntityCacheUtil.removeResult(
        HRProjectModelImpl.ENTITY_CACHE_ENABLED, HRProjectImpl.class, hrProject.getPrimaryKey());

    FinderCacheUtil.removeResult(FINDER_PATH_FIND_ALL, FINDER_ARGS_EMPTY);
  }
  @Override
  protected HRProject removeImpl(HRProject hrProject) throws SystemException {
    hrProject = toUnwrappedModel(hrProject);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, hrProject);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    FinderCacheUtil.removeResult(FINDER_PATH_FIND_ALL, FINDER_ARGS_EMPTY);

    EntityCacheUtil.removeResult(
        HRProjectModelImpl.ENTITY_CACHE_ENABLED, HRProjectImpl.class, hrProject.getPrimaryKey());

    return hrProject;
  }
  @Override
  protected SocialEquityHistory removeImpl(SocialEquityHistory socialEquityHistory)
      throws SystemException {
    socialEquityHistory = toUnwrappedModel(socialEquityHistory);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, socialEquityHistory);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    EntityCacheUtil.removeResult(
        SocialEquityHistoryModelImpl.ENTITY_CACHE_ENABLED,
        SocialEquityHistoryImpl.class,
        socialEquityHistory.getPrimaryKey());

    return socialEquityHistory;
  }
  /**
   * Clears the cache for the faculty.
   *
   * <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(Faculty faculty) {
    EntityCacheUtil.removeResult(
        FacultyModelImpl.ENTITY_CACHE_ENABLED, FacultyImpl.class, faculty.getPrimaryKey());

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
  }
Beispiel #19
0
  /**
   * Clears the cache for the list type.
   *
   * <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(ListType listType) {
    EntityCacheUtil.removeResult(
        ListTypeModelImpl.ENTITY_CACHE_ENABLED, ListTypeImpl.class, listType.getPrimaryKey());

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
  }
  /**
   * Clears the cache for the i project.
   *
   * <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(iProject iProject) {
    EntityCacheUtil.removeResult(
        iProjectModelImpl.ENTITY_CACHE_ENABLED, iProjectImpl.class, iProject.getPrimaryKey());

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
  }
  /**
   * Clears the cache for the bar.
   *
   * <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(Bar bar) {
    EntityCacheUtil.removeResult(
        BarModelImpl.ENTITY_CACHE_ENABLED, BarImpl.class, bar.getPrimaryKey());

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
  }
  /**
   * Clears the cache for the j i r a change item.
   *
   * <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(JIRAChangeItem jiraChangeItem) {
    EntityCacheUtil.removeResult(
        JIRAChangeItemModelImpl.ENTITY_CACHE_ENABLED,
        JIRAChangeItemImpl.class,
        jiraChangeItem.getPrimaryKey());

    FinderCacheUtil.removeResult(FINDER_PATH_FIND_ALL, FINDER_ARGS_EMPTY);
  }
  /**
   * Clears the cache for the ticket.
   *
   * <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(Ticket ticket) {
    EntityCacheUtil.removeResult(
        TicketModelImpl.ENTITY_CACHE_ENABLED, TicketImpl.class, ticket.getPrimaryKey());

    FinderCacheUtil.removeResult(FINDER_PATH_FIND_ALL, FINDER_ARGS_EMPTY);

    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_KEY, new Object[] {ticket.getKey()});
  }
  /**
   * Clears the cache for the class name.
   *
   * <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(ClassName className) {
    EntityCacheUtil.removeResult(
        ClassNameModelImpl.ENTITY_CACHE_ENABLED, ClassNameImpl.class, className.getPrimaryKey());

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);

    clearUniqueFindersCache(className);
  }
  /**
   * Clears the cache for the shopping item field.
   *
   * <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(ShoppingItemField shoppingItemField) {
    EntityCacheUtil.removeResult(
        ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
        ShoppingItemFieldImpl.class,
        shoppingItemField.getPrimaryKey());

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
  }
Beispiel #26
0
  /**
   * Clears the cache for the password tracker.
   *
   * <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(PasswordTracker passwordTracker) {
    EntityCacheUtil.removeResult(
        PasswordTrackerModelImpl.ENTITY_CACHE_ENABLED,
        PasswordTrackerImpl.class,
        passwordTracker.getPrimaryKey());

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
  }
  /**
   * 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);
  }
  /**
   * Clears the cache for the shard.
   *
   * <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(Shard shard) {
    EntityCacheUtil.removeResult(
        ShardModelImpl.ENTITY_CACHE_ENABLED, ShardImpl.class, shard.getPrimaryKey());

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);

    clearUniqueFindersCache(shard);
  }
  @Override
  public void clearCache(List<Image> images) {
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);

    for (Image image : images) {
      EntityCacheUtil.removeResult(
          ImageModelImpl.ENTITY_CACHE_ENABLED, ImageImpl.class, image.getPrimaryKey());
    }
  }
  @Override
  public void clearCache(List<Asset> assets) {
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);

    for (Asset asset : assets) {
      EntityCacheUtil.removeResult(
          AssetModelImpl.ENTITY_CACHE_ENABLED, AssetImpl.class, asset.getPrimaryKey());
    }
  }