Java 使用Spring数据Rest修改子链接

Java 使用Spring数据Rest修改子链接,java,spring,spring-data-rest,Java,Spring,Spring Data Rest,今天,a有一个模型,这个模型有一些孩子: { "_embedded": { "emailTemplates": [ { "identifier": "XPTO", "message": "Email whatever", "active": true, "_links": { "self": { "href": "http://localhost:8080/emai

今天,a有一个模型,这个模型有一些孩子:

{
  "_embedded": {
    "emailTemplates": [
      {
        "identifier": "XPTO",
        "message": "Email whatever",
        "active": true,
        "_links": {
          "self": {
            "href": "http://localhost:8080/emailTemplates/1"
          },
          "communicationChannel": {
            "href": "http://localhost:8080/emailTemplates/1/communicationChannel"
          }
        }
      }
    ]
  },
  "_links": {
    "self": {
      "href": "http://localhost:8080/emailTemplates"
    },
    "profile": {
      "href": "http://localhost:8080/profile/emailTemplates"
    }
  }
}
看,沟通渠道还与链接父亲到孩子。 我需要一些提示来返回直接指向child的链接,如:

 "communicationChannel": {
            "href": "http://localhost:8080/communicationChannel/1"
          }

我该如何解决这个问题?

同样,我也很好奇,我肯定链接是实体的子url有更高的原因,但它不可能获得所有emailTemplates的列表和所有通信渠道的列表,然后将它们放在客户端(即两个请求/查询),相反,您需要遵循每个单独的链接(许多请求/查询)似乎都是这个链接的重复:出于同样的考虑,我相信链接是实体的子url有更高的原因,但它不可能获得所有emailTemplates的列表和所有通信通道的列表,然后将它们放在客户端中(这将是两个请求/查询),相反,您需要遵循每个单独的链接(许多请求/查询)似乎与此链接重复: