Hi,
I have the following structure.

Message (Text)
MessageReading (Message, User)

I'd like to load messages with corresponding MessageReading if it
exists.
I can achieve that with HQL:

var query = session.CreateSQLQuery(
                                @"SELECT {msg.*}, {mr.*}
                                        FROM Message msg
                                        LEFT OUTER JOIN MessageReading mr ON 
(mr.Message_Id = msg.Id  AND
mr.User_Id = :user)")
                                .AddEntity("msg", typeof(Message))
                                .AddEntity("mr", typeof(MessageReading))
                                .SetParameter("user", user.Id);

Is there a way to do the same with Criteria API? (I need it because I
use Rhino Security to add authorization filtering to my queries)

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en.

Reply via email to