java.lang.IllegalArgumentException: Not a managed type: class com.cloudage.membe

JohnnyLiao_WJ 2016-12-14 10:14:51
Error creating bean with name 'defaultCommentService': Unsatisfied dependency expressed through field 'commentRepo': Error creating bean with name 'ICommentRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class com.cloudage.membercenter.entity.Comment; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ICommentRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class com.cloudage.membercenter.entity.Comment

public class Comment extends DateRecord{
/**
*
*/
private static final long serialVersionUID = 1L;
String text;
Article atc;
User author;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
@ManyToOne(optional = false)
public Article getAtc() {
return atc;
}
public void setAtc(Article atc) {
this.atc = atc;
}
@ManyToOne(optional = false)
public User getAuthor() {
return author;
}
public void setAuthor(User author) {
this.author = author;
}


}


@Configuration
@Component
@Service
@Transactional
public class DefaultCommentService implements ICommentService{
@Autowired
ICommentRepository commentRepo;

@Override
public Page<Comment> findAllArticleId(int id, Pageable page) {
return commentRepo.findAllArticleId(id, page);
}

@Override
public Page<Comment> findCommentsOfArticle(int atc_id,int page) {
Sort sort = new Sort(Direction.DESC, "createDate");
PageRequest request = new PageRequest(atc_id, 10, sort);
return commentRepo.findAllArticleId(atc_id, request);
}

@Override
public Comment save(Comment commment) {
// TODO Auto-generated method stub
return commentRepo.save(commment);
}








}
...全文
481 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

80,330

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧