throws SystemException {
lfFileStorage = toUnwrappedModel(lfFileStorage);
boolean isNew = lfFileStorage.isNew();
LFFileStorageModelImpl lfFileStorageModelImpl = (LFFileStorageModelImpl) lfFileStorage;
Session session = null;
try {
session = openSession();
if (lfFileStorage.isNew()) {
session.save(lfFileStorage);
lfFileStorage.setNew(false);
} else {
session.merge(lfFileStorage);
}
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
if (isNew || !LFFileStorageModelImpl.COLUMN_BITMASK_ENABLED) {
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
else {
if ((lfFileStorageModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_FILENAME.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
lfFileStorageModelImpl.getOriginalFilename()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_FILENAME, args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_FILENAME,
args);
args = new Object[] { lfFileStorageModelImpl.getFilename() };
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_FILENAME, args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_FILENAME,
args);
}