@Override public Entry toEntityModel() { EntryImpl entryImpl = new EntryImpl(); entryImpl.setEntryId(entryId); entryImpl.setGroupId(groupId); entryImpl.setCompanyId(companyId); entryImpl.setUserId(userId); if (userName == null) { entryImpl.setUserName(StringPool.BLANK); } else { entryImpl.setUserName(userName); } if (createDate == Long.MIN_VALUE) { entryImpl.setCreateDate(null); } else { entryImpl.setCreateDate(new Date(createDate)); } if (modifiedDate == Long.MIN_VALUE) { entryImpl.setModifiedDate(null); } else { entryImpl.setModifiedDate(new Date(modifiedDate)); } if (name == null) { entryImpl.setName(StringPool.BLANK); } else { entryImpl.setName(name); } if (email == null) { entryImpl.setEmail(StringPool.BLANK); } else { entryImpl.setEmail(email); } if (message == null) { entryImpl.setMessage(StringPool.BLANK); } else { entryImpl.setMessage(message); } entryImpl.setGuestbookId(guestbookId); entryImpl.resetOriginalValues(); return entryImpl; }