/** * Adds the entry to the database. Also notifies the appropriate model listeners. * * @param entry the entry * @return the entry that was added */ @Indexable(type = IndexableType.REINDEX) @Override public Entry addEntry(Entry entry) { entry.setNew(true); return entryPersistence.update(entry); }
public int compareTo(Entry entry) { int value = 0; if (getCreateDate() < entry.getCreateDate()) { value = -1; } else if (getCreateDate() > entry.getCreateDate()) { value = 1; } else { value = 0; } value = value * -1; if (value != 0) { return value; } return 0; }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } Entry entry = null; try { entry = (Entry) obj; } catch (ClassCastException cce) { return false; } long primaryKey = entry.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } }
/** * Adds the entry to the database. Also notifies the appropriate model listeners. * * @param entry the entry to add * @return the entry that was added * @throws SystemException if a system exception occurred */ public Entry addEntry(Entry entry) throws SystemException { entry.setNew(true); return entryPersistence.update(entry, false); }
/** * Updates the entry in the database. Also notifies the appropriate model listeners. * * @param entry the entry to update * @param merge whether to merge the entry with the current session. See {@link * com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, * com.liferay.portal.model.BaseModel, boolean)} for an explanation. * @return the entry that was updated * @throws SystemException if a system exception occurred */ public Entry updateEntry(Entry entry, boolean merge) throws SystemException { entry.setNew(false); return entryPersistence.update(entry, merge); }