Im creating a RESTful API using Spring-data-rest. I have an entity;
@Entity
@Table(name = "pricingoptionsets")
@JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@pricingOptionSetId") //To prevent fetch loops
public class PricingOptionSet {
//Region Properties
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="PricingOptionSetId", nullable=false, unique=true)
private Long pricingOptionSetId;
@ManyToOne
@JoinColumn(name = "ProductId")
private Product product;
Now on the Getters & Setters, If I have the following:
public Product getProducts() {
return product;
}
I receive the Product information in the JSON of the response. But if the getter is:
public Product getProduct() {
return product;
}
Then Product information is not included anymore:S
Any ideas how to fix that? Btw, I'm using a simple repository that extends CRUDRepository