Returning returned model object to json String using spring data jpa with hibernate <p>I am using spring data jpa with hibernate This is my dao interface </p> <pre><code>@Repository public interface IUserDAO extends JpaRepository&lt;User, Integer&gt;{ User findByUsername( final String username ); } </code></pre> <p>This is my User class</p> <pre><code>Entity @Table(name="USER") public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="ID", nullable = false) private int id; @Column(name="USERNAME", nullable = false) private String username; @Column(name="NAME", nullable = false) private String name; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getName() { return name; } public void setName(String name) { this.name = name; } } </code></pre> <p>This is my UserImplClass</p> <pre><code>This is my UserImplClass{ @Autowired private IUserDAO iUserDAO; public String findUserByUserName(String username) { User user =iUserDAO.findByUsername(username); Convert user to json object from framework level automatically // i can add my one implemenation of converting user to json here ,but i want to achieve it from framework so that my code is not scattered on every service level return "jsonStringOfUserObject" } </code></pre> <p><strong>Is it possible with spring data jpa with hibernate so that i do not have to write code for converting java object to json string in every service level?</strong></p> <p><strong>I am using spring ,therefore i want to achieve it from spring .</strong></p>