throws SystemException {
lfResource = toUnwrappedModel(lfResource);
boolean isNew = lfResource.isNew();
LFResourceModelImpl lfResourceModelImpl = (LFResourceModelImpl) lfResource;
Session session = null;
try {
session = openSession();
if (lfResource.isNew()) {
session.save(lfResource);
lfResource.setNew(false);
} else {
session.merge(lfResource);
}
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
if (isNew || !LFResourceModelImpl.COLUMN_BITMASK_ENABLED) {
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
else {
if ((lfResourceModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PACKAGEID.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
lfResourceModelImpl.getOriginalPackageID()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PACKAGEID,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PACKAGEID,
args);
args = new Object[] { lfResourceModelImpl.getPackageID() };
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PACKAGEID,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PACKAGEID,
args);
}
if ((lfResourceModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PACKAGEIDANDRESOURCEID.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
lfResourceModelImpl.getOriginalPackageID(),
lfResourceModelImpl.getOriginalResourceID()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PACKAGEIDANDRESOURCEID,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PACKAGEIDANDRESOURCEID,
args);
args = new Object[] {
lfResourceModelImpl.getPackageID(),
lfResourceModelImpl.getResourceID()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PACKAGEIDANDRESOURCEID,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PACKAGEIDANDRESOURCEID,