throws SystemException {
lfCertificate = toUnwrappedModel(lfCertificate);
boolean isNew = lfCertificate.isNew();
LFCertificateModelImpl lfCertificateModelImpl = (LFCertificateModelImpl) lfCertificate;
Session session = null;
try {
session = openSession();
if (lfCertificate.isNew()) {
session.save(lfCertificate);
lfCertificate.setNew(false);
} else {
session.merge(lfCertificate);
}
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
if (isNew || !LFCertificateModelImpl.COLUMN_BITMASK_ENABLED) {
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
else {
if ((lfCertificateModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COMPANYID.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
lfCertificateModelImpl.getOriginalCompanyID()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMPANYID,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COMPANYID,
args);
args = new Object[] { lfCertificateModelImpl.getCompanyID() };
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMPANYID,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COMPANYID,
args);