throws SystemException {
lfRole = toUnwrappedModel(lfRole);
boolean isNew = lfRole.isNew();
LFRoleModelImpl lfRoleModelImpl = (LFRoleModelImpl) lfRole;
Session session = null;
try {
session = openSession();
if (lfRole.isNew()) {
session.save(lfRole);
lfRole.setNew(false);
} else {
session.merge(lfRole);
}
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
if (isNew || !LFRoleModelImpl.COLUMN_BITMASK_ENABLED) {
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
else {
if ((lfRoleModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PERMISSION.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
lfRoleModelImpl.getOriginalPermission()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PERMISSION,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PERMISSION,
args);
args = new Object[] { lfRoleModelImpl.getPermission() };
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PERMISSION,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PERMISSION,
args);
}
if ((lfRoleModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ROLEIDANDPERMISSION.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
lfRoleModelImpl.getOriginalLiferayRoleID(),
lfRoleModelImpl.getOriginalPermission()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ROLEIDANDPERMISSION,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ROLEIDANDPERMISSION,
args);
args = new Object[] {
lfRoleModelImpl.getLiferayRoleID(),
lfRoleModelImpl.getPermission()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ROLEIDANDPERMISSION,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ROLEIDANDPERMISSION,
args);
}
if ((lfRoleModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_DEFAULTANDPERMISSION.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
lfRoleModelImpl.getOriginalIsDefault(),
lfRoleModelImpl.getOriginalPermission()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_DEFAULTANDPERMISSION,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_DEFAULTANDPERMISSION,
args);
args = new Object[] {
lfRoleModelImpl.getIsDefault(),
lfRoleModelImpl.getPermission()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_DEFAULTANDPERMISSION,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_DEFAULTANDPERMISSION,