Spring Data Rest (SDR ) bug? Persistent Entity Must not be null

跟風遠走 提交于 2019-11-29 14:14:11

Spring Data REST can only return data for which the repository is registered for. In the other question that you reference, you'll notice that they created a custom repository specifically for the type that they needed. This isn't a bug in SDR, it's just how it functions. It also keeps it RESTful.

So in your case, SDR can only return NewTask or collections of NewTask.

In Spring Boot, if spring main application failed to scan for your domain(POJO) classes then this error will be thrown unless you put your all classes in the same package. Then you have add component scan annotation on top of Spring main application class

@ComponentScan(basePackages = "com.aaa.bbbb.ccccc")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!