dennisbyrne wrote:
chiku_78 wrote:
you could probably map objects to the system tables
... or he could call org.hibernate.cfg.Configuration.getClassMapping().getProperty().getColumnIterator() ;-)
That assumes he has a property mapped to the column name. The original post made no such indication.
To the original poster:
Check out chapter 21 of the mysql manual entitled "The INFORMATION_SCHEMA Information Database" for the info you need. Take a close look specifically at the sections labeled "The INFORMATION_SCHEMA TABLES Table" and "The INFORMATION_SCHEMA COLUMNS Table." It would take a little thought of course, but you should be able to map some objects to those tables in a way which would allow you to perform HQL queries to get the info you need. You'll just need to be careful in your choice of primary keys.