/** * 功能描述:为formBean赋初值 * * @param dataCount * @param formBean */ public void setFormBean(DataCount dataCount, DefaultForm formBean) throws DBException, LogicException { if (dataCount != null) { formBean.setNewFriend(dataCount.getNewFriend().toString()); formBean.setNewSalutation(dataCount.getNewSalutation().toString()); formBean.setNewShortMessage(dataCount.getNewShortMessage().toString()); formBean.setNewTeacherAppraise(dataCount.getNewTeacherAppraise().toString()); } }
/** * 功能描述:用户操作短消息时,为短消息的接收方的统计表的新短消息字段值减1 * * @param userId * @return * @throws DBException */ public boolean minusNewShortMessage(Long userId) throws DBException { DataCount dataCount = findDataCountByUserId(userId); // 判断是否存在这样的用户统计实体 if (dataCount != null) { Long newShortMessage = dataCount.getNewShortMessage(); if (newShortMessage != null && newShortMessage.longValue() > 0) { dataCount.setNewShortMessage(new Long(newShortMessage.longValue() - 1)); dataCountDao.update(dataCount); return true; } } return false; }