@Override public void resetOriginalValues() { ReleaseModelImpl releaseModelImpl = this; releaseModelImpl._originalServletContextName = releaseModelImpl._servletContextName; releaseModelImpl._columnBitmask = 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); } }
@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())); }
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); } } }