throws SystemException {
lfAnswer = toUnwrappedModel(lfAnswer);
boolean isNew = lfAnswer.isNew();
LFAnswerModelImpl lfAnswerModelImpl = (LFAnswerModelImpl) lfAnswer;
Session session = null;
try {
session = openSession();
if (lfAnswer.isNew()) {
session.save(lfAnswer);
lfAnswer.setNew(false);
} else {
session.merge(lfAnswer);
}
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
if (isNew || !LFAnswerModelImpl.COLUMN_BITMASK_ENABLED) {
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
else {
if ((lfAnswerModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_QUESTIONID.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
lfAnswerModelImpl.getOriginalQuestionId()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_QUESTIONID,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_QUESTIONID,
args);
args = new Object[] { lfAnswerModelImpl.getQuestionId() };
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_QUESTIONID,
args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_QUESTIONID,
args);