I believe this is possible. The following comment explains how. If
this doesn't work, I have an example that someone sent to me.
Unfortunately, I haven't had time to look at it myself.

http://raibledesigns.com/rd/entry/moving_from_spring_s_xml#comment-1225842234000

Matt

On Sun, Dec 21, 2008 at 2:03 PM, dusty <dustin_pea...@yahoo.com> wrote:
>
> Does anyone have experience creating a GenericDaoHibernate without using XML
> or subclassing and just using Spring annotations?
>
> So I think I want to be able to do something like:
>
> private GenericDao<Person,Long> personDao;
>
> @Autowired
> setPersonDao(GenericDao<Person,Long> personDao){
>    this.personDao = personDao;
> }
>
> You can't just slap a @Repository annotation on GenericDaoHibernate since it
> doesn't know how to resolve the Class constructor argument.  You need to be
> able to inject the Model class you want at runtime.
>
> I saw Matt's blog post about how he manually created the GenericDao.  Is it
> recommended to do that in your Actions?  in Prepare?  Don't you want it to
> be a singleton?
>
> To be honest most "grown-up" applications I have rarely use the
> GenericDaoHibernate without subclassing, but my lack of understanding of
> Spring makes me wonder if its possible to do this with autowiring.
> --
> View this message in context: 
> http://www.nabble.com/Create-GenericDaoHibernate-with-no-XML-tp21119151s2369p21119151.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
> For additional commands, e-mail: users-h...@appfuse.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net

Reply via email to