Store_id = 105 and = 106
2014-03-06 21:41:44.7276|DEBUG|NHibernate.SQL|********************************************************************************SELECT store0_.Id as Id10_0_, store0_.Name as Name10_0_ FROM [Store] store0_ WHERE store0_.Id=@p0;@p0 = 105 [Type: Int32 (0)]********************************************************************************SELECT products0_.Store_id as Store2_1_, products0_.Product_id as Product1_1_, product1_.Id as Id8_0_, product1_.Name as Name8_0_, product1_.Price as Price8_0_, product1_.Aisle as Aisle8_0_, product1_.Shelf as Shelf8_0_ FROM StoreProduct products0_ left outer join [Product] product1_ on products0_.Product_id=product1_.Id WHERE products0_.Store_id=@p0;@p0 = 105 [Type: Int32 (0)]********************************************************************************SELECT storesstoc0_.Product_id as Product1_1_, storesstoc0_.Store_id as Store2_1_, store1_.Id as Id10_0_, store1_.Name as Name10_0_ FROM StoreProduct storesstoc0_ left outer join [Store] store1_ on storesstoc0_.Store_id=store1_.Id WHERE storesstoc0_.Product_id=@p0;@p0 = 307 [Type: Int32 (0)]********************************************************************************SELECT storesstoc0_.Product_id as Product1_1_, storesstoc0_.Store_id as Store2_1_, store1_.Id as Id10_0_, store1_.Name as Name10_0_ FROM StoreProduct storesstoc0_ left outer join [Store] store1_ on storesstoc0_.Store_id=store1_.Id WHERE storesstoc0_.Product_id=@p0;@p0 = 308 [Type: Int32 (0)]********************************************************************************SELECT storesstoc0_.Product_id as Product1_1_, storesstoc0_.Store_id as Store2_1_, store1_.Id as Id10_0_, store1_.Name as Name10_0_ FROM StoreProduct storesstoc0_ left outer join [Store] store1_ on storesstoc0_.Store_id=store1_.Id WHERE storesstoc0_.Product_id=@p0;@p0 = 309 [Type: Int32 (0)]********************************************************************************SELECT storesstoc0_.Product_id as Product1_1_, storesstoc0_.Store_id as Store2_1_, store1_.Id as Id10_0_, store1_.Name as Name10_0_ FROM StoreProduct storesstoc0_ left outer join [Store] store1_ on storesstoc0_.Store_id=store1_.Id WHERE storesstoc0_.Product_id=@p0;@p0 = 310 [Type: Int32 (0)]********************************************************************************SELECT products0_.Store_id as Store2_1_, products0_.Product_id as Product1_1_, product1_.Id as Id8_0_, product1_.Name as Name8_0_, product1_.Price as Price8_0_, product1_.Aisle as Aisle8_0_, product1_.Shelf as Shelf8_0_ FROM StoreProduct products0_ left outer join [Product] product1_ on products0_.Product_id=product1_.Id WHERE products0_.Store_id=@p0;@p0 = 106 [Type: Int32 (0)]********************************************************************************SELECT storesstoc0_.Product_id as Product1_1_, storesstoc0_.Store_id as Store2_1_, store1_.Id as Id10_0_, store1_.Name as Name10_0_ FROM StoreProduct storesstoc0_ left outer join [Store] store1_ on storesstoc0_.Store_id=store1_.Id WHERE storesstoc0_.Product_id=@p0;@p0 = 311 [Type: Int32 (0)]********************************************************************************SELECT storesstoc0_.Product_id as Product1_1_, storesstoc0_.Store_id as Store2_1_, store1_.Id as Id10_0_, store1_.Name as Name10_0_ FROM StoreProduct storesstoc0_ left outer join [Store] store1_ on storesstoc0_.Store_id=store1_.Id WHERE storesstoc0_.Product_id=@p0;@p0 = 312 [Type: Int32 (0)]********************************************************************************SELECT staff0_.Store_id as Store4_1_, staff0_.Id as Id1_, staff0_.Id as Id7_0_, staff0_.FirstName as FirstName7_0_, staff0_.LastName as LastName7_0_, staff0_.Store_id as Store4_7_0_ FROM [Employee] staff0_ WHERE staff0_.Store_id=@p0;@p0 = 106 [Type: Int32 (0)]********************************************************************************SELECT staff0_.Store_id as Store4_1_, staff0_.Id as Id1_, staff0_.Id as Id7_0_, staff0_.FirstName as FirstName7_0_, staff0_.LastName as LastName7_0_, staff0_.Store_id as Store4_7_0_ FROM [Employee] staff0_ WHERE staff0_.Store_id=@p0;@p0 = 105 [Type: Int32 (0)]********************************************************************************DELETE FROM StoreProduct WHERE Store_id = @p0;@p0 = 105 [Type: Int32 (0)]********************************************************************************DELETE FROM StoreProduct WHERE Store_id = @p0;@p0 = 106 [Type: Int32 (0)]********************************************************************************Batch commands:command 0:DELETE FROM [Product] WHERE Id = @p0;@p0 = 307 [Type: Int32 (0)]command 1:DELETE FROM [Product] WHERE Id = @p0;@p0 = 308 [Type: Int32 (0)]command 2:DELETE FROM [Product] WHERE Id = @p0;@p0 = 309 [Type: Int32 (0)]command 3:DELETE FROM [Product] WHERE Id = @p0;@p0 = 311 [Type: Int32 (0)]command 4:DELETE FROM [Product] WHERE Id = @p0;@p0 = 312 [Type: Int32 (0)]********************************************************************************Batch commands:command 0:DELETE FROM [Employee] WHERE Id = @p0;@p0 = 256 [Type: Int32 (0)]command 1:DELETE FROM [Employee] WHERE Id = @p0;@p0 = 257 [Type: Int32 (0)]********************************************************************************Batch commands:command 0:DELETE FROM [Store] WHERE Id = @p0;@p0 = 106 [Type: Int32 (0)]********************************************************************************Batch commands:command 0:DELETE FROM [Product] WHERE Id = @p0;@p0 = 310 [Type: Int32 (0)]********************************************************************************Batch commands:command 0:DELETE FROM [Employee] WHERE Id = @p0;@p0 = 258 [Type: Int32 (0)]command 1:DELETE FROM [Employee] WHERE Id = @p0;@p0 = 259 [Type: Int32 (0)]command 2:DELETE FROM [Employee] WHERE Id = @p0;@p0 = 260 [Type: Int32 (0)]********************************************************************************Batch commands:command 0:DELETE FROM [Store] WHERE Id = @p0;@p0 = 105 [Type: Int32 (0)]********************************************************************************
var store = session.Get<Store>(StoreId);
Sounds like a cascade is wrong somewhere...
I notice that procuct.stores stocked in is cascade.all that seems pretty wrong to me (suspect it means if I delete a product it will also delete the store)
Hth, Chris
--
You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluent-nhibern...@googlegroups.com.
To post to this group, send email to fluent-n...@googlegroups.com.
Visit this group at http://groups.google.com/group/fluent-nhibernate.
For more options, visit https://groups.google.com/d/optout.