2014-06-06 136 views
0

我想与Spring数据休息与jqGrid,每一件事情都很好,除了我想返回对象所有作为序列化,所以在ManyToOne关系现在我只得到该对象的链接,而我想要的让它序列化。春天的数据休息

{ 
    "_links" : { 
    "next" : { 
     "href" : "http://localhost:8080/noc/carrier/?page=1&size=1" 
    }, 
    "self" : { 
     "href" : "http://localhost:8080/noc/carrier/?page=0&size=1{&sort}", 
     "templated" : true 
    }, 
    "search" : { 
     "href" : "http://localhost:8080/noc/carrier/search" 
    } 
    }, 
    "_embedded" : { 
    "carrier" : [ { 
     "_carrierName" : "Sample", 
     "_customerGroupID" : 0, 
     "_vendorGroupID" : 0, 
     "_customer" : true, 
     "_vendor" : true, 
     "_buyRateId" : 281, 
     "_sellRateId" : 282, 
     "_customerTimezoneId" : 460, 
     "_vendorTimezoneId" : 460, 
     "_vendorTimeBandId" : 1, 
     "_customerTimeBandId" : 1, 
     "_customerCurrencyId" : 1, 
     "_vendorCurrencyId" : 1, 
     "_links" : { 
     "self" : { 
      "href" : "http://localhost:8080/noc/carrier/1" 
     }, 
     "_accountManager" : { 
      "href" : "http://localhost:8080/noc/carrier/1/_accountManager" 
     } 
     } 
    } ] 
    }, 
    "page" : { 
    "size" : 1, 
    "totalElements" : 465, 
    "totalPages" : 465, 
    "number" : 0 
    } 
} 

正如你所看到的,在的AccountManager类返回的链接,但我希望它也序列化,所以我可以显示jqGrid的name属性。

问候 Shahbour

+0

你好,我发现,如果我删除了帐户管理器的仓库,它完美的工作,但我仍然需要两者。它接受@Entity并迭代其属性,为由存储库管理的属性创建链接,并在任何嵌入或简单属性中进行复制。 – Shahbour

+0

我想这个答案我[问题](http://stackoverflow.com/questions/23264044/spring-data-rest-disable-hypertext-application-language-hal-in-json-applica)http:// stackoverflow。 COM /问题/ 23264044 /弹簧数据休息,禁止超文本应用语言-HAL-在-JSON-APPLICA – Shahbour

回答