nhibernate « Entity « JPA Q&A

1. Can a NHibernate join be constrained from two separate entities?    stackoverflow.com

I need to build an HQL query that uses the same entity twice, but with different constaints coming from previous entities. For example:

select count(distinct a.id),
    count(disintct b.id),

2. Get all Master entities but only some Detail    stackoverflow.com

I want to get all StatoRete (Master entity) but populate Dettagli collection (details entities) with only entities that has property Done=0. This query doesn't return StatoRete with no details with Done=0 and ...

3. Projects with using DomainModel or AnemicModel patterns    stackoverflow.com

I'm a new in designing. I wanna to see real project's examples with applying either DomainModel or AnemicModel or maybe TransactionScript. could somebody give me links to source codes such projects? or ...