protected static com.liferay.portlet.polls.model.PollsQuestion update(
com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
throws com.liferay.portal.SystemException {
PollsQuestionPersistence persistence = (PollsQuestionPersistence)InstancePool.get(PERSISTENCE);
ModelListener listener = null;
if (Validator.isNotNull(LISTENER)) {
try {
listener = (ModelListener)Class.forName(LISTENER).newInstance();
}
catch (Exception e) {
Logger.error(PollsQuestionUtil.class,e.getMessage(),e);
}
}
boolean isNew = pollsQuestion.isNew();
if (listener != null) {
if (isNew) {
listener.onBeforeCreate(pollsQuestion);
}
else {
listener.onBeforeUpdate(pollsQuestion);
}
}
pollsQuestion = persistence.update(pollsQuestion);
if (listener != null) {
if (isNew) {
listener.onAfterCreate(pollsQuestion);
}
else {
listener.onAfterUpdate(pollsQuestion);
}
}
return pollsQuestion;
}