title: How to show JSON column name using JPA?
body: <p>Within my entity class I have 3 Strings along with getters and setters.  I am using Jackson to display results.  I would like to see column and data like this...</p>
  
  <pre><code>[[id:"1", name:"Tim", address:"street"]]
  </code></pre>
  
  <p>However, I only get the data back without the column name as below...</p>
  
  <pre><code>[["1","Tom","street"]]
  </code></pre>
  
  <p>Is there a jackson annotation that would show the column name?  Does this have something to do with marshalling/unmarshalling?  </p>
  
  <p><strong>Entity</strong></p>
  
  <pre><code>@Entity
  @Table(name = "Personnel")
  public class User implements Serializable {
  
  private String id;
  private String name;
  private String address;
  
  public User(String id, String name, String address) 
   {
      this.id = id;
      this.name = name;
      this.address = address;
   }
  
  @Id
  @Column(name = "name", unique = true, nullable = false)
  public String getName() {
      return this.name;
  }....
  //setters getters
  </code></pre>
  
  <p><strong>Impl</strong></p>
  
  <pre><code>@Transactional(readOnly=true)
  public List&lt;User&gt; getUsers() throws Exception{
  List&lt;User&gt; userList= new ArrayList&lt;User&gt;();
  String qry = "select u.id, u.name, u.address from User as u where u.name = 'Tim'" ;
  List&lt;String&gt; jsonrows;
  Query query = sessionFactory.getCurrentSession().createQuery(qry);  
  userList.addAll(query.list());
  return userList;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>@RequestMapping(value = "/users/find", method = RequestMethod.GET, produces="application/json")
  public List&lt;User&gt; getUserName() {
   List&lt;User&gt; result= null;
      try {  
          { result = service.getUserList();
          }
        } catch (Exception e) {  
            e.printStackTrace();  
        } 
      return result;
  }
  </code></pre>
  
  <p>So I tried to use GSON and then got back numbers for my column names with the code below.  </p>
  
  <p>Any ideas?</p>