throws SystemException {
lfPackage = toUnwrappedModel(lfPackage);
boolean isNew = lfPackage.isNew();
LFPackageModelImpl lfPackageModelImpl = (LFPackageModelImpl) lfPackage;
Session session = null;
try {
session = openSession();
if (lfPackage.isNew()) {
session.save(lfPackage);
lfPackage.setNew(false);
} else {
session.merge(lfPackage);
}
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
if (isNew || !LFPackageModelImpl.COLUMN_BITMASK_ENABLED) {
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
else {
if ((lfPackageModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_INSTANCE.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
lfPackageModelImpl.getOriginalCourseID()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_INSTANCE, args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_INSTANCE,
args);
args = new Object[] { lfPackageModelImpl.getCourseID() };
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_INSTANCE, args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_INSTANCE,
args);
}
if ((lfPackageModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COURSEID.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
lfPackageModelImpl.getOriginalCourseID()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COURSEID, args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COURSEID,
args);
args = new Object[] { lfPackageModelImpl.getCourseID() };
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COURSEID, args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COURSEID,
args);
}