Questions tagged [nhibernate-cascade]

37 questions
0
votes
1 answer

Fluent NHibernate Joined References Ignoring Cascade Rule

I'm using Fluent NHibernate in an attempt to improve testability and maintainability on a web application that is using a legacy database and I'm having some trouble mapping this structure properly: I have two tables that really represent one entity…
0
votes
1 answer

Hibernate self Bidirectional OneToMany Cascade remove doesn't work

I have a problem with a self bidirectional relationship does not work cascade remove, i have the following entity that what it does is basically put together a family tree with many levels, if I try something like em.remove (family) it does not…
0
votes
2 answers

NHibernate cascade and generated guid ids - why are they not generated for the children on save?

I do the following: var @case = new Case { Name = "test" }; // User is persistent and loaded in the same session User.AddCase(@case); // sets @case.User = User too Session.Update(User); response.CaseId =…
asgerhallas
  • 16,890
  • 6
  • 50
  • 68
0
votes
1 answer

cascade="all" or cascade="save-update"? NHibernate one-to-many won't update

Problem encountered When I create a transient instance with a children collection, everything gets persisted. Aside, if I update an instance of one of the children object, it doesn't get updated when I save the parent object. I'm actually using…
Will Marcouiller
  • 23,773
  • 22
  • 96
  • 162
0
votes
1 answer

Cascading with traceability using NHibernate?

I have read on the inverse and cascade mapping attributes, and would like to know: Whether is it possible to use them in my scenario? And if it is, How to parameterize them accordingly? Let's say I have two classes, Customer and Invoice, both…
Will Marcouiller
  • 23,773
  • 22
  • 96
  • 162
0
votes
1 answer

Why does cascade SaveUpdate triggers a Delete statement?

This is related to this question I asked previously. In Request mapping I have it set to SaveUpdate due and in Discount mapping I have cascade set to none. There are two scenarios: The first is new request and new discount. Created both then added…
Chris Crew
  • 353
  • 4
  • 15
0
votes
1 answer

Cascading delete for optional inverse joins

There is a following simplified mapping for one of our entity classes:
JustAMartin
  • 13,165
  • 18
  • 99
  • 183
1 2
3