But you don't want the Session in the domain model I thought.

Anyway, after a few hours digging around looking at how other people
do this stuff with respect to DDD in particular, it looks like I am
asking the wrong question to a certain extent. The way it is done in
the DDD site sample app (dddsample.sourceforge.net if you;'re
interested) is to have repositories - one for each "aggregate" - set
of linked classes (typical example is an order which aggregates order
lines and possibily delivery history). The repositories are
implemented as interfaces and have persistence neutral finders "get
all outstanding orders with credit-stopped customers" for example.
This is part of the domain model, but returns typical jpa/hibernate
persisted objects. The implementation of the repository is hibernate
aware and uses getCurrentSession() quite freely. The implementation is
injected via spring.

Back in my context, this means I want my repository impls to be EM or
session aware too - so my original question stands - but the
repository mechanism separates the domain model from the direct
persistence layer which should allay your concerns.

Tim

On Apr 28, 6:48 am, Viktor Klang <[email protected]> wrote:
> Also, if you use Hibernate, you can use:
>
> *Session.createFilter*(city.getAddresses(), "where this.name like
> 'S%'").list();
>
> On Tue, Apr 28, 2009 at 5:31 AM, Derek Chen-Becker 
> <[email protected]>wrote:
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to