aspose file tools
The moose likes Object Relational Mapping and the fly likes Using Hibernate to look up table metadata? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "Using Hibernate to look up table metadata?" Watch "Using Hibernate to look up table metadata?" New topic
Author

Using Hibernate to look up table metadata?

M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 375
Is there a way I can use hibernate to get table metadata? I need to find the max size of a varchar field in the database.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Typically this isn't the sort of thing the Hibernate developers imagined you would need to do. Hibernate is supposed to be an abstraction layer between you and the mechanics of the database after all. But you can query the catalog directly via a SQL query. There are also classes in the the API to get at meta data (which Hiebrnate tools do to perform DDL). The hbm2ddl tool for example.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 375
Thanks for the link. I need it to do string lenght validation.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Using Hibernate to look up table metadata?
 
Similar Threads
Hibernate: adding underscore to attibute names
Loading the metadata of the table
Hibernate equivalent of MetaData
Hibernate
i m new to hibernate