コード例 #1
0
  @Override
  public void resetOriginalValues() {
    ReleaseModelImpl releaseModelImpl = this;

    releaseModelImpl._originalServletContextName = releaseModelImpl._servletContextName;

    releaseModelImpl._columnBitmask = 0;
  }
コード例 #2
0
  protected void clearUniqueFindersCache(Release release) {
    ReleaseModelImpl releaseModelImpl = (ReleaseModelImpl) release;

    Object[] args = new Object[] {release.getServletContextName()};

    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_SERVLETCONTEXTNAME, args);
    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_SERVLETCONTEXTNAME, args);

    if ((releaseModelImpl.getColumnBitmask()
            & FINDER_PATH_FETCH_BY_SERVLETCONTEXTNAME.getColumnBitmask())
        != 0) {
      args = new Object[] {releaseModelImpl.getOriginalServletContextName()};

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_SERVLETCONTEXTNAME, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_SERVLETCONTEXTNAME, args);
    }
  }
コード例 #3
0
  @Test
  public void testResetOriginalValues() throws Exception {
    if (!PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
      return;
    }

    Release newRelease = addRelease();

    _persistence.clearCache();

    ReleaseModelImpl existingReleaseModelImpl =
        (ReleaseModelImpl) _persistence.findByPrimaryKey(newRelease.getPrimaryKey());

    Assert.assertTrue(
        Validator.equals(
            existingReleaseModelImpl.getServletContextName(),
            existingReleaseModelImpl.getOriginalServletContextName()));
  }
コード例 #4
0
  protected void cacheUniqueFindersCache(Release release) {
    if (release.isNew()) {
      Object[] args = new Object[] {release.getServletContextName()};

      FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_SERVLETCONTEXTNAME, args, Long.valueOf(1));
      FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_SERVLETCONTEXTNAME, args, release);
    } else {
      ReleaseModelImpl releaseModelImpl = (ReleaseModelImpl) release;

      if ((releaseModelImpl.getColumnBitmask()
              & FINDER_PATH_FETCH_BY_SERVLETCONTEXTNAME.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {release.getServletContextName()};

        FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_SERVLETCONTEXTNAME, args, Long.valueOf(1));
        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_SERVLETCONTEXTNAME, args, release);
      }
    }
  }