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 190343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:14:54+00:00 2026-05-11T16:14:54+00:00

How do I use the Inverse Attribute? If I am not mistaken, for one

  • 0

How do I use the Inverse Attribute? If I am not mistaken, for one to many relationships the inverse attribute must be set to true. For many-to-many relationships, one of the entity class inverse attributes must be set to true and another set to false.

Anyone can shed some lights on this?

  • 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-11T16:14:54+00:00Added an answer on May 11, 2026 at 4:14 pm

    The inverse attribute must not be set to true …

    You use the inverse attribute to specify the ‘owner’ of the association. (An association can have only one owner, so one end has to be set to inverse, the other has to be set to ‘non inverse’).
    (Owner: inverse=false; Non-owner: inverse=true)

    In a one-to-many association, if you do not mark the collection as the inverse end, then NHibernate will perform an additional UPDATE.
    In fact, in this case, NHibernate will first insert the entity that is contained in the collection, if necessary insert the entity that owns the collection, and afterwards, updates the ‘collection entity’, so that the foreign key is set and the association is made. (Note that this also means that the foreign key in your DB should be nullable).

    When you mark the collection end as ‘inverse’, then NHibernate will first persist the entity that ‘owns’ the collection, and will persist the entities that are in the collection afterwards, avoiding an additional UPDATE statement.

    So, in an bi-directional association, you always have one inverse end.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple entity called Store built in Xcode's data modeler for use
The inverse question of How can I transform XML into a List or String[]?
Scenario: I have a customer object with lazy loading enabled. I use that throughout
I'm wanting to make a CoreData entity called Employees, some Employees could have a
I have a table http://img36.imageshack.us/i/beztytuuszxq.png/ and mapping: public class CategoryMap : ClassMap<Category> { public
I have the following tables: A -- Id : int SomeString : varchar(20) B
I'm working on a file based commenting system with in-line comments (only 1 level).
I'm getting the Save unsaved transient entities error in NHibernate. I have an aggregate
I hate this stuff. Just to note. + means OR * means AND !
Possible Duplicate: Circle line collision detection I'm trying to do collision testing between a

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.