Hi, 1. I need to get the hibernate column name corresponding to a database column name that I have in my application. Is there a way to query the mapping file for that class / table and retrieve hibernate property name for a given column name ? 2. Is there also a way to get all the columns for a particular class / table in my application at runtime ?
Please can anyone tell me which API in hibernate would let me do this ?
posted 14 years ago
I got the API by which we can get the properties and with that retrieve the name of the column it is associated with. By getting the Mapping class from the configuration object and then getting the property fform that. I dont think there is a way to get the name of the Hibernate property if the name of the column is know. If anyone knows otherwise, please let me know.
Initally when we designed the system, when we hadnt thought of hibernate yet; a requirement said that we had to assign rules to the columns of a table. But now it would have to be the fields of the hibernate file instead. So I was wondering if I could get the column names from hibernate and still maintain the same requirement.