In an application I am developing using a heritage Oracle DB, in Fluent NBibernet (which I am quite new ). DB has composite keys which include foreign keys and database-built columns. The generated column is provided by calling a DB function with the table name and one of the other foreign key parts. The overall key parts generated are not unique, and I can not change it. Generated bodies are often used as foreign keys on other tables.
If I create atity mapping that specifies the whole key because it is in the database, then we can not use any identification generation strategies that breaks the unit of work < P> If I make entity mapping that specifies the only generated column in the form of primary key, then I can use trigger-detection to generate the ID, and I get a working unit, however Neither can I use the problem when I want to update, or use any child storage: other parts of the key are not included in the WHERE statement.
Can someone advise me to move forward?
- If I stick with the mapping composite keys, then can I use the trigger detection to expand the nhibernate to output to SQL? If so, can you suggest a starting point?
- If I map to a single column key, can I include other properties in the WHERE clause for HasMany Mapping and Updates?
Unfortunately, as you've already figured out, Not supported.
My suggestion is to do manually (using custom SQL, for example) and yes, it breaks the Uo, but this is also true of
identity .
Comments
Post a Comment