public static EntityCommitComment createEntity(CommitComment gitComment, GenericDao dao) {
if (gitComment == null) {
return null;
}
EntityCommitComment comment = getCommitCommentByURL(gitComment.getId(), dao);
if (comment == null) {
comment = new EntityCommitComment();
comment.setMineredAt(new Date());
comment.setCommitId(gitComment.getCommitId());
comment.setBody(JsfUtil.filterChar(gitComment.getBody()));
comment.setBodyHtml(gitComment.getBodyHtml());
comment.setBodyText(gitComment.getBodyText());
comment.setCreatedAt(gitComment.getCreatedAt());
comment.setIdComment(gitComment.getId());
comment.setLine(gitComment.getLine());
comment.setPathCommitComment(gitComment.getPath());
comment.setPosition(gitComment.getPosition());
comment.setUpdatedAt(gitComment.getUpdatedAt());
comment.setUrl(gitComment.getUrl());
comment.setUser(UserServices.createEntity(gitComment.getUser(), dao, false));
dao.insert(comment);
}
return comment;