> As I said, try adding a <version> to the AB class.  I can certainly
> understand that it seems like you shouldn't *have* to do that, but without
> this, NHibernate as currently implemented (unless this has changed in 2.1
> and I missed it) CAN'T determine by itself if an assigned/composite keyed
> entity is transient.

Thanks again for the tips Anne. I added the version column and added
the mapping (I am using 2.1.0.4000 version of NHibernate)

    <version name="Version" type="timestamp">
      <column name="Ver" />
    </version>

but it didn't solve my problem. I still get persistence exception. I
googled for information about version column and found that it was
used mostly for optimistic locking operation and didn't find nothing
about relation of version column to assigned id's or cascades... Maybe
you could direct me to the right source?

However I found the suitable solution/workaround. I simply removed
composite-id mapping and replaced it with two many-to-one mappings
respectively and added cascading there. Also I added the Id column to
the AB table and mapped it on the AB class new Id property. So now
it's working almost as I wanted it to.

Do you know maybe a better way to map many-to-many relation using
intermediate link class?

bye,
  Mindaugas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to