title: Hibernate: Set field by its column name
body: <p>Is there a way to set some field in an entity with only an information for the field column name?</p>
  
  <p>for example:</p>
  
  <pre><code>@Entity
  @Table(name = "T_PERSON")
  public class Person {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "p_id")
      private int id;
  
      @Column(name = "p_name")
      private String name;
  
      // getters and setters for id and name
  }
  </code></pre>
  
  <p>So I have <code>p_name</code> and <code>T_PERSON</code> as an Input and I want to set some value in it.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/2921451/get-column-name-in-jpa">this</a> and <a href="https://stackoverflow.com/questions/2023700/get-column-name-of-property-mapped-with-hibernate">this</a> to get field names using column names, and I could use <code>Reflection</code> to get the setter method, but Are there any alternatives to reflection?</p>