Example #1
0
  /**
   * Creates a new release with the primary key. Does not add the release to the database.
   *
   * @param releaseId the primary key for the new release
   * @return the new release
   */
  public Release create(long releaseId) {
    Release release = new ReleaseImpl();

    release.setNew(true);
    release.setPrimaryKey(releaseId);

    return release;
  }
Example #2
0
  @Override
  public Release updateImpl(com.liferay.portal.model.Release release) throws SystemException {
    release = toUnwrappedModel(release);

    boolean isNew = release.isNew();

    Session session = null;

    try {
      session = openSession();

      if (release.isNew()) {
        session.save(release);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !ReleaseModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    }

    EntityCacheUtil.putResult(
        ReleaseModelImpl.ENTITY_CACHE_ENABLED, ReleaseImpl.class, release.getPrimaryKey(), release);

    clearUniqueFindersCache(release);
    cacheUniqueFindersCache(release);

    return release;
  }