'Spring 2.6.3 how to return id in response

Im making a api with spring, in which I return an array of objects, each of them contains name and an array. The problem is that it doesn't return the Id of each object which I store in jpa repository. The question is how do I turn Id visible in response

@Column
private @Id @GeneratedValue Long id;
private String QuestionName;


Solution 1:[1]

Add getter and setter methods for id field and then try.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dipak Jadhav