Nhibernate hasmany not updating

For example, we have a Site Product that represents a Product on a Site.When we first designed the database, we setup the relationship entites with a single field surrogate key: A unique, automatically generated ID that only exists to serve the database.We wanted to eliminate those surrogate keys and use the combination of Site Id and Product Id as a composite key instead.We had similar circumstances in a couple of other relationship tables that we also wanted to improve.We ended up with this: After reworking our entities and Fluent NHibernate maps to mirror our new structure, we ran into the following rather cryptic exception when running our unit test suite against SQLLite: Notice that Product Id is one component of the composite key for Media In Pool and one component of the composite key for Site Product.As it turns out, NHibernate simply cannot deal with one field being mapped twice.

Here’s a portion of our original database structure: The changes we wanted to make fell into two categories.

The problem was it had no meaning to the business so our screens tended to know the Site Id and the Product Id but not the Site Product Id.

This forced us to constantly join or lookup the Site Product table to get the Site Product Id so we could get to the data we needed to perform work.

If we make the reference to Media In Pool read only, the Media Id does not get set and the insert fails; If we make the Site Product reference read only, the insert fails with a null Site Id.

A couple members of the team looked for solutions all afternoon.

Search for nhibernate hasmany not updating:

nhibernate hasmany not updating-60nhibernate hasmany not updating-11nhibernate hasmany not updating-9nhibernate hasmany not updating-46

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “nhibernate hasmany not updating”

  1. I love to praise the Lord,:innocent: and take care of my kids. I love to shop, I love to cook,and I love to have good clean fun:innocent::relieved: Love the Trinity, Almighty God, Jesus, & the Holy Spirit!!! I would enjoy watching sports with someone special I am a very down 2 earth person. Right now I keep myself very busy by, playing piano at several churches as well as church funtions.

  2. The three control samples, the approximate ages of which were made known to the laboratories, are listed below. T/32) from a tomb excavated at Qasr Ibrîm in Nubia by Professor J. This linen was dated in the British Museum Research Laboratory using liquid scintillation counting, giving a radiocarbon age of 2,010 ± 80 yr BP (BM-2558).

  3. I really do like her.” As for whether that “like” will build into something that lasts after the music stops, the couple are happy to keep hope alive. Now it’s almost like we’re past dating….” She grins at Maks and playfully adds, “Now we’re working on a kid!