content object(s) exposed in resources are JPA Entities. The interesting point about wrapping a JPA Entity in a resource comes with the low-level nature of an Entity itself, which supposedly represents a restricted identifiable domain area. This definition should ideally be entirely translated to the exposed REST resources.
So, how do we represent an Entity in REST HATEOAS? How do we safely and uniformly represent the JPA associations?
This recipe presents a simple and conservative method to answer these questions.
Index.java). Here is another entity that is used:
Exchange.java. This entity presents a similar strategy to expose its JPA associations: ...