Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6850099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:04:56+00:00 2026-05-27T01:04:56+00:00

I have the fallowing NHibernate-Mapping: <class name=Activity table=Activity lazy=false > <cache usage=read-write/> <id name=Id

  • 0

I have the fallowing NHibernate-Mapping:

<class name="Activity" table="Activity" lazy="false"  >
<cache usage="read-write"/>
<id name="Id" column="Id" type="Guid">      
                <generator class="assigned"/>
</id>
<property name="Subject" column="Subject" type="String" length="255"  />
<many-to-one  name="ParentActivity" class="Activity" foreign-key="FK_Activity_ParentActivity" lazy="proxy" fetch="select">
    <column name="ParentActivityId"/>
</many-to-one>
<set name="Activities" lazy="true" inverse="true" cascade="none" >
    <key>
        <column name="ParentActivityId"/>
    </key>
    <one-to-many class="Activity"/>
</set>

I have now an Entity Activity (x) which has another Entity Activity (y) set as ParentActivity.
I am searching for the solution, that, when I delete the entity y, the reference from x to y is set to null. Now I become an error, that I cannot delete x because of the FK_Activity_ParentActivity.
Can someone point me to the right way how I can do this? – Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:04:56+00:00Added an answer on May 27, 2026 at 1:04 am

    Maybe this post of Ayende Rahien will help you: the different between all all-delete-orphans and save-update

    Here is what each cascade option means:

    • none – do not do any cascades, let the users handles them by themselves.
    • save-update – when the object is saved/updated, check the associations and save/update any object that require it (including
      save/update the associations in many-to-many scenario).
    • delete – when the object is deleted, delete all the objects in the association.
    • delete-orphan – when the object is deleted, delete all the objects in the association. In addition to that, when an object is removed
      from the association and not associated with another object
      (orphaned), also delete it.
    • all – when an object is save/update/delete, check the associations and save/update/delete all the objects found.
    • all-delete-orphan – when an object is save/update/delete, check the associations and save/update/delete all the objects found. In
      additional to that, when an object is removed from the association and
      not associated with another object (orphaned), also delete it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following mapping: <hibernate-mapping package=server.modules.stats.data> <class name=User table=user> <id name=id> <generator class=native></generator>
Lets say I have the following mapping: <hibernate-mapping package=mypackage> <class name=User table=user> <id name=id
I have the following nhibernate mapping <class name=Customer> <id name=Id> <generator class=native/> </id> <property
NHibernate is driving me 'Nuts'!!! I have the following mapping. Which returns this error
I have the following Hibernate Mapping, which has to be mapped using the Table
i have a self join employees entity class with id,name and ref columns that
I have the following mapping file: <?xml version=1.0 encoding=utf-8 ?> <hibernate-mapping xmlns=urn:nhibernate-mapping-2.2 assembly=Project1.Accounts namespace=Project1.Core.Domain>
I have situation where I am mapping table's columns to the primary key of
I'm having trouble mapping the following in NHibernate: I have two tables (these are
We create the database using the schemaExport class of nHibernate. I now have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.