【发布时间】:2018-04-15 19:56:23
【问题描述】:
我不明白为什么 spring 为 self 和 rel 创建相同的链接?有没有办法禁用它?我认为这只是我的问题,因为我在阅读的文档中没有遇到这样的问题。
这是我的实体映射:
@Getter
@Setter
@Document
public class Ad {
@Id
private String id;
private String description;
private Banner banner;
}
@Getter
@Setter
public class Banner {
private String id;
private String filename;
}
这是我的存储库:
@RepositoryRestResource
public interface AdRepository extends CrudRepository<Ad, String> {
}
我点击以下网址:http://localhost:8558/ads
我不使用任何预测。我的应用程序现在很原始。没有什么具体的。
提前致谢!
【问题讨论】:
-
你能分享你的实体映射代码吗?
-
@szxnyc,当然。完成了
-
您的请求是什么样的?你在使用投影吗?
-
@szxnyc,我在问题中回答,请查收
标签: spring spring-data-rest spring-hateoas