Thanks Karel, I'm just now getting back to this. So it looks like I can
construct a DOM and pass it to the session:
Configuration config = new Configuration();
config.addXML(mappingdocument.asXML());
this.sessionFactory = config.configure().buildSessionFactory();
Does this DOM look just like the .hbm.xml file? It doesn't look like
the sessionFactory configuration is included here (data from
hibernate.cfg.xml) - how is it added?
On a separate topic - do you have a version of the basic tutorial that
uses annotations rather than the Class hbm.xml file?
Thanks again for your help!
--john
----- Original Message -----
From: Karel Maesen <
[hidden email]>
Date: Monday, February 25, 2008 12:05 pm
Subject: Re: [hibernatespatial-users] way to specify class's hibernate
mapping at runtime?
> 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
>
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users