You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
Model:
class Message
{
User Author { get; set; }
string Text { get; set; }
}
class MessageReading
{
User ReadBy { get; set; }
Message Message { get; set; }
public bool IsRead { get; set; }
}
The MessageReading table has only ReadBy and Message columns.
Existence of a record means the message was read by specific user.
Absence of a record means the message wasn't read by the given user.
Given a user, for each message object in the db I'd like to get a
MessageReading object with the IsRead property correctly set.
How do I perform this query with NH?
If the question seems unclear, please ask :)
Vadimmer
unread,
Nov 23, 2009, 11:43:57 AM11/23/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
Tried the following HQL and got the following exception.
NHibernate.QueryException : No data type for node: IdentNode mr
[SELECT msg, mr
FROM Model.Message msg
WHERE msg.Contest = :contest
LEFT OUTER JOIN MessageReading mr ON (mr.Message = msg AND mr.User
= :user)]
Is this style of joins supported? Is there any way to do this type of
join (to an unassociated entity)?