| 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.
|
 |
 |
|
|
subject: Using Hibernate to look up table metadata?
|
|
|