|
From: Steve S. <sst...@gm...> - 2005-06-20 19:04:20
|
I really do mean something like that ;) A good 90% (or more depending on the complexity of a given operation) of hibernate dao ops can be mapped directly to named queries in the hbm descriptor. I sat down last nite and jammed out a quick proxy that would intercept method calls on the dao interface and then map to the named queries without requiring a concrete dao impl. My interest in this is to prevent having to write the 'glue' for the majority of my hibernate dao impls. The code tends to be quite repetitive, and can be removed entirely by using the method described above. Hope this helps, Steve James Estes wrote: > I assume by "autowiring" you mean the ability to pass in a bean and the > named parameters are automagically pulled from the bean and bound to the > named query. If so, you might have a look at the > findByNamedQueryAndValueBean method on HibernateTemplate: > > http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/orm/hibernate/HibernateTemplate.html#findByNamedQueryAndValueBean(java.lang.String,%20java.lang.Object) > <http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/orm/hibernate/HibernateTemplate.html#findByNamedQueryAndValueBean(java.lang.String,%20java.lang.Object)> > > Just for clarity...when I hear "autowire" I think "dependencies injected > from spring managed beans in the container". Unless you really do mean > something like that? > > James > > > On 6/19/05, *Steve Stallion* <sst...@gm... > <mailto:sst...@gm...>> wrote: > > hello all, > > i am about to start on a project aimed at simplyfing hibernate dao > integration into spring. The general idea is to provide autowiring for > named queries to a given dao interface - ive been quite suprised this > hasnt been done yet. > > is anyone aware if this has indeed been proposed, or if so, if there are > any implementations available already? > > > thanks! > > Steve > > -- > Yet magic and hierarchy > arise from the same source, > and this source has a null pointer. > > Reference the NULL within NULL, > it is the gateway to all wizardry. > > > ------------------------------------------------------- > SF.Net <http://SF.Net> email is sponsored by: Discover Easy Linux > Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > <http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click> > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > <mailto:Spr...@li...> > https://lists.sourceforge.net/lists/listinfo/springframework-developer > <https://lists.sourceforge.net/lists/listinfo/springframework-developer> > > -- Yet magic and hierarchy arise from the same source, and this source has a null pointer. Reference the NULL within NULL, it is the gateway to all wizardry. |