way to specify class's hibernate mapping at runtime?

2 messages Options
Embed this post
Permalink
John Cartwright-8

way to specify class's hibernate mapping at runtime?

Reply Threaded More More options
Print post
Permalink
Hello All,

Is there I way that I can avoid using a class's hbm.xml file and instead
provide that information at runtime?

For example, I have a DynaBean that I'd like to persist.  I can discover
at runtime all the information that is in the hbm file, I just need a
way provide it to hibernate w/o going through a XML file.

Thanks!

--john

_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users

Karel Maesen

Re: way to specify class's hibernate mapping at runtime?

Reply Threaded More More options
Print post
Permalink
Hi John,

I've been working on an experimental feature that reads table  
metadata from the database using JDBC, uses the metadata to generate  
at runtime a bean class file, and a Hibernate mapping from  the bean  
to the table.  If you can replace the DynaBeans with the generated  
Classes, this might meet your requirements. If not, then the code  
will at least present you with an example on how to build a mapping  
file at runtime.

I will check in the code later today. You can find it in the source  
trunk, in package "org.hibernatespatial.pojo". Examples on how to use  
it can be found in the (very preliminary) test classes in package  
"org.hibernatespatial.test.pojo" (Class TestPojoUtility).

Please not that this feature is not yet complete.

Regards,

Karel


On 25 Feb 2008, at 06:44, [hidden email] wrote:

> Hello All,
>
> Is there I way that I can avoid using a class's hbm.xml file and  
> instead
> provide that information at runtime?
>
> For example, I have a DynaBean that I'd like to persist.  I can  
> discover
> at runtime all the information that is in the hbm file, I just need a
> way provide it to hibernate w/o going through a XML file.
>
> Thanks!
>
> --john
>
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/ 
> hibernatespatial-users

_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users