On Fri, Jul 4, 2008 at 2:46 PM, Alejandro Galue <[EMAIL PROTECTED]> wrote:
> Hello,
>
> This question is more related to spring than opennms but I hope you
> can help me with that.
>
> I want to know how can I add additional entities to hibernate
> sessionFactory bean without modifying applicationContext-dao.xml and
> rebuild opennms-dao-x.x.x.jar
>
> I found some people that suggest a classpath automatic loading and
> avoid put explicit classes list on annotatedClasses property on
> AnnotationSessionFactoryBean; but no one point me to a working example.
>
> Spring people point to use JPA and persistence.xml, because it uses
> automatic class adding with @Entity annotations but, neither found how
> can use this with AnnotationSessionFactoryBean.
>
> Any suggestions ?
Hi Alejandro....
I also have been wondering it there is a mechanism to do classpath scanning
to load the resources...
I have a couple of thoughts on this
1. When we move to OSGi in the relatively near future then we could use
OSGi extender patter to have each module declare the model objects that
provide and have a hibernate module automatically detect them and create the
hibernate session. It is described here:
http://www.osgi.org/blog/2007/06/osgi-and-hibernate.html
2. Since we are not currently using OSGi however we can use spring to do
something similar. We can create a HibernateClassesFactoryBean that gathers
up the classes and creates a list that can be used as input to
AnnotationSessionFactoryBean I'm not exactly sure how to do this but in
Spring 2.5 there is a some package scanning that happens that might help.
That's where I'd look if I were trying to get that working myself.
Maybe I'll add that as a to do item for my 'sample app' that I'm using to
help with the DevJam architecture stuff
Hope that helps!
Matt
>
>
> Alejandro.
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Please read the OpenNMS Mailing List FAQ:
> http://www.opennms.org/index.php/Mailing_List_FAQ
>
> opennms-devel mailing list
>
> To *unsubscribe* or change your subscription options, see the bottom of
> this page:
> https://lists.sourceforge.net/lists/listinfo/opennms-devel
>
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ
opennms-devel mailing list
To *unsubscribe* or change your subscription options, see the bottom of this
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel