コード例 #1
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);
    }
  }
コード例 #2
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()));
  }