class ForumService {

	public void addPost(Post post){
		postDao.save(post);
		
		User user = post.getUser();
		user.setCredit(user.getCredit() + 5);
		userDao.update(user);
		
		Topic topic = topicDao.get(post.getTopic().getTopicId());
		topic.setReplies(topic.getReplies() + 1);
		topic.setLastPost(new Date());
		//topic处于Hibernate受管状态，无须显示更新
		//topicDao.update(topic);
	}

}