Im actually about to write a tutorial thing about howto
JPA-HIBERNATE-SPRING in wicket... It could be something worth looking
at, Im trying to have a clean seperation of domain / database and
frontend (wicket).
A few things that seems cant be seperated, the
openEntityManagerInView(in your web.xml) filter and spring context has
to get loaded via wicket spring packaged, otherwise than that its nice
to work with:)
regards Nino
Al Maw wrote:
Uwe Schäfer wrote:
Subclass WebRequestCycle, and construct it with an EntityManager.
thanks! That may well be an alternative to the common
ServletFilter-pattern.
Well, err, yes. ;-)
One question: isn´t it a little better to have the ThreadLocal Holder
for the EntityManager separate from the RequestCycle, but notified of
its events? Somewhat a 'listener' that registers itself ?
If you have one, then sure. Whatever feels cleanest to you. There is
no single best way with all this stuff.
My DAOs actually use Spring's HibernateTemplate, so getting hold of a
session in there is done using sessionFactory.getCurrentSession().
It's a bit different in your case with JPA stuff.
This would decouple things as well as make configuration at runtime
easier. (The 'Favor decoration over inheritance' thing.)
What am i missing?
Nothing, it sounds like. ;-)
Regards,
Al
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]