2014-06-06 130 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

回答