I am creating an application using Nhibernate . I am executing the Stored 
procedure from my mapping class. 

But it is giving me the error  
Batch update returned unexpected row count from update; actual row count: -1
; expected: 1



Here is the mapping file. I am trying to delete the Reviews and Even I want 
to delete the objectives if any. 


public ReviewMap()
        {
            Table("Reviews");
            SqlDelete("exec DeleteReview ?");

            List(x => x.Objectives, m =>
            {
                m.Table("Objectives");
                m.Cascade(Cascade.All.Include(Cascade.DeleteOrphans));
                m.Key(k => k.Column("ReviewId"));
                m.Where("DeletionDate is null");
                m.OrderBy("OrderNo");
                m.Index(x => x.Column("OrderNo"));
                m.Inverse(true);
            }, m => m.OneToMany()); 
        }

 public ObjectiveMap()
        {
            Table("Objectives");

            // Use "soft deletes" to allow us to capture results against 
deleted items
            Where("DeletionDate is null");
            SqlDelete("update Objectives set DeletionDate = getutcdate(), 
OrderNo = 1 where id=?");

            ManyToOne(x => x.Review, m =>
            {
                m.Column("ReviewId");
                m.NotNullable(true);
            });

            Property(x => x.Details, m =>
            {
                m.NotNullable(true);
                m.Length(1000);
                m.Column("Details");
            });

            Property("OrderNo", m =>
            {
                m.NotNullable(false);
            });

        }





-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to