I want to get the name of the getter of my entity property. I only have the database column name and I can also get the property. So either is obtaining the getter from the column name or from property. I have the following:
@JoinColumn(name = "CurrencyId")
public Currency getCurrency() {
return currency;
}
I want to have getCurrency() As you can see the column name is CurrencyId. I would like to do something like:
Method method = getMethodFromColumnName(Class class, String columnName)
System.out.println("Getter is:" + method.getName())
Getter is: getCurrency
Maybe there is a hibernate trick to do this. Thanks in advance.