@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;
  }
  @Override
  public LayoutSet updateImpl(com.liferay.portal.model.LayoutSet layoutSet, boolean merge)
      throws SystemException {
    layoutSet = toUnwrappedModel(layoutSet);

    boolean isNew = layoutSet.isNew();

    LayoutSetModelImpl layoutSetModelImpl = (LayoutSetModelImpl) layoutSet;

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.update(session, layoutSet, merge);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

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

    if (!isNew
        && ((layoutSet.getGroupId() != layoutSetModelImpl.getOriginalGroupId())
            || (layoutSet.getPrivateLayout() != layoutSetModelImpl.getOriginalPrivateLayout()))) {
      FinderCacheUtil.removeResult(
          FINDER_PATH_FETCH_BY_G_P,
          new Object[] {
            Long.valueOf(layoutSetModelImpl.getOriginalGroupId()),
            Boolean.valueOf(layoutSetModelImpl.getOriginalPrivateLayout())
          });
    }

    if (isNew
        || ((layoutSet.getGroupId() != layoutSetModelImpl.getOriginalGroupId())
            || (layoutSet.getPrivateLayout() != layoutSetModelImpl.getOriginalPrivateLayout()))) {
      FinderCacheUtil.putResult(
          FINDER_PATH_FETCH_BY_G_P,
          new Object[] {
            Long.valueOf(layoutSet.getGroupId()), Boolean.valueOf(layoutSet.getPrivateLayout())
          },
          layoutSet);
    }

    return layoutSet;
  }
예제 #3
0
  @Override
  public void resetOriginalValues() {
    LayoutSetModelImpl layoutSetModelImpl = this;

    layoutSetModelImpl._originalGroupId = layoutSetModelImpl._groupId;

    layoutSetModelImpl._setOriginalGroupId = false;

    layoutSetModelImpl._originalPrivateLayout = layoutSetModelImpl._privateLayout;

    layoutSetModelImpl._setOriginalPrivateLayout = false;

    layoutSetModelImpl._originalLayoutSetPrototypeUuid = layoutSetModelImpl._layoutSetPrototypeUuid;

    layoutSetModelImpl._columnBitmask = 0;
  }
  @Override
  public void resetOriginalValues() {
    LayoutSetModelImpl layoutSetModelImpl = this;

    layoutSetModelImpl._originalGroupId = layoutSetModelImpl._groupId;

    layoutSetModelImpl._setOriginalGroupId = false;

    layoutSetModelImpl._setModifiedDate = false;

    layoutSetModelImpl._originalPrivateLayout = layoutSetModelImpl._privateLayout;

    layoutSetModelImpl._setOriginalPrivateLayout = false;

    layoutSetModelImpl._originalLayoutSetPrototypeUuid = layoutSetModelImpl._layoutSetPrototypeUuid;

    setCompanyFallbackVirtualHostname(null);

    setVirtualHostname(null);

    layoutSetModelImpl._columnBitmask = 0;
  }