protected static com.liferay.portlet.polls.model.PollsDisplay remove( com.liferay.portlet.polls.ejb.PollsDisplayPK pollsDisplayPK) throws com.liferay.portlet.polls.NoSuchDisplayException, com.liferay.portal.SystemException { PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE); ModelListener listener = null; if (Validator.isNotNull(LISTENER)) { try { listener = (ModelListener) Class.forName(LISTENER).newInstance(); } catch (Exception e) { Logger.error(PollsDisplayUtil.class, e.getMessage(), e); } } if (listener != null) { listener.onBeforeRemove(findByPrimaryKey(pollsDisplayPK)); } com.liferay.portlet.polls.model.PollsDisplay pollsDisplay = persistence.remove(pollsDisplayPK); if (listener != null) { listener.onAfterRemove(pollsDisplay); } return pollsDisplay; }
public static com.liferay.portal.model.Address update(com.liferay.portal.model.Address address) throws com.liferay.portal.SystemException { AddressPersistence persistence = (AddressPersistence) InstancePool.get(PERSISTENCE); ModelListener listener = null; if (Validator.isNotNull(LISTENER)) { try { listener = (ModelListener) Class.forName(LISTENER).newInstance(); } catch (Exception e) { _log.error(e.getMessage()); } } boolean isNew = address.isNew(); if (listener != null) { if (isNew) { listener.onBeforeCreate(address); } else { listener.onBeforeUpdate(address); } } address = persistence.update(address); if (listener != null) { if (isNew) { listener.onAfterCreate(address); } else { listener.onAfterUpdate(address); } } return address; }
public static com.liferay.portal.model.Address remove(java.lang.String addressId) throws com.liferay.portal.NoSuchAddressException, com.liferay.portal.SystemException { AddressPersistence persistence = (AddressPersistence) InstancePool.get(PERSISTENCE); ModelListener listener = null; if (Validator.isNotNull(LISTENER)) { try { listener = (ModelListener) Class.forName(LISTENER).newInstance(); } catch (Exception e) { _log.error(e.getMessage()); } } if (listener != null) { listener.onBeforeRemove(findByPrimaryKey(addressId)); } com.liferay.portal.model.Address address = persistence.remove(addressId); if (listener != null) { listener.onAfterRemove(address); } return address; }
private PollsQuestion _put(String questionId, PollsQuestion obj) { if (!_cacheable) { return obj; } else if (questionId == null) { return obj; } else { String key = questionId.toString(); if (Validator.isNotNull(key)) { _cache.put(key, obj, primaryGroup); } return obj; } }
private ShoppingOrder _put(String orderId, ShoppingOrder obj) { if (!_cacheable) { return obj; } else if (orderId == null) { return obj; } else { String key = orderId.toString(); if (Validator.isNotNull(key)) { _cache.flushEntry(key); _cache.putInCache(key, obj); } return obj; } }
protected static com.liferay.portlet.polls.model.PollsDisplay update( com.liferay.portlet.polls.model.PollsDisplay pollsDisplay) throws com.liferay.portal.SystemException { PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE); ModelListener listener = null; if (Validator.isNotNull(LISTENER)) { try { listener = (ModelListener) Class.forName(LISTENER).newInstance(); } catch (Exception e) { Logger.error(PollsDisplayUtil.class, e.getMessage(), e); } } boolean isNew = pollsDisplay.isNew(); if (listener != null) { if (isNew) { listener.onBeforeCreate(pollsDisplay); } else { listener.onBeforeUpdate(pollsDisplay); } } pollsDisplay = persistence.update(pollsDisplay); if (listener != null) { if (isNew) { listener.onAfterCreate(pollsDisplay); } else { listener.onAfterUpdate(pollsDisplay); } } return pollsDisplay; }