java - 在 webflux 应用程序中添加 hatoas 支持后控制器抛出错误
问题描述
将 RepresentationModel 添加到我的实体时,我在从数据库获取数据时收到错误消息。我可以毫无问题地发帖。
@Document(collection = "airports")
public class Airport extends RepresentationModel<Airport> {
@Id
private String icao;
}
和控制器
@GetMapping
public Flux<Airport> getAirports() {
return repository.findAll();
}
我收到以下错误:
java.lang.IllegalStateException: Cannot set property links because no setter, no wither and it's not part of the persistence constructor public com.example.mongo.entities.Airport()!
我认为可能是lombok的问题,并手动实现了构造函数、getter和setter,但无济于事!
解决方案
推荐阅读
- arangodb - arangoimport 中如何使用 --define 选项?
- regex - 正则表达式检查字符串是否不为空并且不仅包含 html 标签
- reactjs - react-native:当 api 响应更新为状态将进入无限循环但无限数组正在控制台中打印时,在 useEffect 挂钩调用
- rest - 休息API。是否可以根据客户端配置要求可选参数?
- kubernetes - 如何编辑/修补 kubernetes 部署以使用 python 添加标签
- bash - Bash/Linux - 比较脚本中的十进制数字,来自 .csv 列的数据
- highcharts - 如何在 Highcharts 中将 CSV 文件中的附加列显示为工具提示
- php - 移动函数 - Pascal 到 PHP
- java - 通知recyclerview项目在onMoving时不中断
- c++ - 如何使用 BOTTOM-UP DP 方法找到 GCD=1 的子序列数?