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)