I am working with a legacy app. I have beans representing the tables. As part of an upload process, I am given a list of column_names and values for a set of rows for the table. Using reflection, I want to call the appropriate
setter for the bean given the column_name.
In browsing the Hibernate API, I cannot see how to obtain the setter (or getter) method given a column name:
Code:
@Entity
@Table("table_name")
public class Test
@Column(name="a_column")
private String theColumn;
public String getTheColumn() { return theColumn;}
public void setTheColumn(String s) {theColumn=s;}
...
So, given the string "a_column", how can I deterministically find the Property that defines the getter/setter methods, i.e., "setTheColumn" ??
The closest I could find was ColumnMetadata, but I cannot find how to go from column name to setter method.
TIA