Hi,
Is there a way to get the SQL column name from Hibernate.
I don't want to use Strings for creating Restrictions because changes in the data model and the Hibernate Beans wouldn't result in compiler errors. So a changed column name would produce errors at runtime instead of compile time.
My idea was that the Hibernate Tools would create extra methods which return the SQL column name for a property, like:
getPkUserId() ... Property in Hibernate Bean representing the primary key of a table
getPkUserIdSqlName() ... Method which returns the SQL column name as string
So I could use these methods in Criterias and would get a compile error if the column name has changed -> because the Hibernate tools renamed the according getter.
I searched a lot but didn't find anything. I can't understand why nobody would have the same problem / idea?
I already asked this question in the Hibernate forum but I didn't get a stisfying answer:
http://forum.hibernate.org/viewtopic.ph ... highlight=
Thanks!
RĂ¼diger Engelberger