0

I am trying to work out with Spring Data Rest with jqGrid, every thing is good except i want to return the objects all as serialized , so in ManyToOne relation now i only get a link for that object while i want to get it serialized .

    {
  "_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
  }
}

As you can see , the accountManager class in returned as link , but i want it to be also serialized so i can show the Name Property in jqGrid.

Best Regards Shahbour

Shahbour
  • 1,323
  • 1
  • 16
  • 42
  • Hello , i found out that if i removed the Repository of the account Manager it worked perfectly , but still i need to both. It takes an @Entity and iterates over its properties, creating links for those properties that are managed by a Repository and copying across any embedded or simple properties. – Shahbour Jun 06 '14 at 19:08
  • I think this answer my [question] (http://stackoverflow.com/questions/23264044/spring-data-rest-disable-hypertext-application-language-hal-in-json-applica) http://stackoverflow.com/questions/23264044/spring-data-rest-disable-hypertext-application-language-hal-in-json-applica – Shahbour Jun 06 '14 at 19:59

1 Answers1

0

This can accomplished with Projections. Here is the revalant JIRA

Stackee007
  • 3,196
  • 1
  • 26
  • 39