Hi Oskar,

I do not have OneToMany relationship to mark as inverse. here are the 
mappings.

public void TestCode()
        {
            Session.Delete(notificationObjectForDelete);

            Session.Delete(mainNotificationObjectForDelete);

            
//  If the lines below are not executed I got Deletes into the database.        
    
//  If the lines below are executed I got updates statements.             
var notification = Session.Get<Notification>(someOtherId);             var
 newMailNotificationObject = new MainNotification(notification); 
            Session.Save(newMailNotificationObject);         }


public class NotificationMap : ClassMap<Notification>
    {
        public NotificationMap()
        {
            Table("notifications");

            Id(n => n.Id, "notification_id");
            References<NotificationTemplate>(n => n.NotificationTemplate, 
"notification_template_id");
            DiscriminateSubClassesOnColumn("notification_type");
        }
    }


public class MailNotificationMap : ClassMap<MailNotification<INotification>>
    {
        public MailNotificationMap()
        {
            Table("email_notifications");
 
            Id(n => n.Id, "email_notification_id");
            References<Notification>(n => n.Notification, "notification_id");
        }
    }


<https://lh5.googleusercontent.com/-kOZjQU8RWsI/ToAndFQoBNI/AAAAAAAAAZQ/8Z7jtAQtZ3Q/delete.png>


-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/fyU5o44KWvAJ.
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