[英]Path based on a non-PK unique field in spring-data-rest
Given an @Entity declared with the following fields: 给定使用以下字段声明的@Entity:
@Id
private String idgeo;
private String isoCtryCd;
private String randomField;
with the default spring configuration I get resource paths ending with .../{idgeo}. 使用默认的spring配置,我得到以... / {idgeo}结尾的资源路径。
Is there an option in the spring configuration to use other (unique) fields as the resource path ending? Spring配置中是否可以使用其他(唯一)字段作为资源路径结尾? In my example it'd be .../{isoCtryCd}
在我的示例中,它将为... / {isoCtryCd}
Thank you! 谢谢!
Actually this feature will be introduced in Spring Data Rest 2.5. 实际上,该功能将在Spring Data Rest 2.5中引入。 Currently there is a 2.5.0.M1 milestone release containing this feature.
当前有一个包含此功能的2.5.0.M1里程碑版本。
This part of the documentation shows how to use a different entity attribute for item resource uris. 文档的此部分显示了如何对项目资源uri使用不同的实体属性。
http://docs.spring.io/spring-data/rest/docs/2.5.0.M1/reference/html/#_customizing_item_resource_uris http://docs.spring.io/spring-data/rest/docs/2.5.0.M1/reference/html/#_customizing_item_resource_uris
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.