I’m currently working on a solution to automatically generate ExtJS forms based on
a hibernate mapping (I use hibernate reverse engineering for that based on @Annotations).
Hibernate has a
getPropertiesInterator()
funciton for that. Which is accessible like this
((LocalSessionFactoryBean)sessionFactory).getConfiguration().getClassMapping(<Classname>.class.getName())
Which lists the properties of the table. I use this information to generate ExtJS inputs out of it
varchar => input
text => textarea
etc.
My question is, if there is maybe another (maybe better) way to get this information out of my hibernate configuration?
Regards
JS
I ended up using
To get the MetaData either by
[String]ClassName or byClass.classWith this information you can do something like this…
And pars this information later on.
See
http://docs.jboss.org/hibernate/core/3.5/api/org/hibernate/SessionFactory.html#getClassMetadata%28java.lang.String%29
for more information.
Hibernate has even an example for this in their docs…
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/objectstate.html#objectstate-metadata