Hi Sofija Both identity and native are post insert generators, so it sounds like NHibernate is not able to get the newly inserted ID from the database when updating the view.
Please can you provide some further information? Ideally the DBMS are you using, and a failing test showing your scenario including: the table and view schema, your fluent mapping of the view, test code and the exception. Also please can you give the issues you are having with stored procedures and NHibernate? I've used them to insert data into a legacy database and found NHibernate works quite well in my scenario. Thanks Michael On Friday, 16 March 2012 23:03:59 UTC, Sofija Blazevski wrote: > > Hello, everyone! > > I'm new to NHibernate, and I would like to use it together with > FluentNHibernate. > I've been trying to use them together for an updatable view scenario. > > This is the problem: > > None of the following Id generator classes > <generator class="identity" /> > <generator class="native" /> > > allows inserting into updatable view. Updatable view (more precisely > database server) takes care of assigning id. > Each time I get "Null id" (or is it "Null identifier" ) thrown from > ISession.SaveOrUpdate method. > While, on the other hand, same scenario with inserting into table > works perfectly. > > On database everything is tested to work. > NHibernate version is 3.2.0.4000 > > What is correct way to setup NHibernate to allow inserting into a view > without providing value for whatever field is set as Id? > > I would like to use NHibernate for an application with intensive usage > of views and stored procedures. > Now, I know you probably don't like usage of updatable views, and I > would not like to get into discussion on why do I use them, I simply > need to use them - if I'm gonna use any ORM framework as there is no > painless way to just use stored procedures (I mean in any ORM in any > technology I came across so far). > > Thanks in advance for helping. > > - Sofija > > On Friday, 16 March 2012 23:03:59 UTC, Sofija Blazevski wrote: > > Hello, everyone! > > I'm new to NHibernate, and I would like to use it together with > FluentNHibernate. > I've been trying to use them together for an updatable view scenario. > > This is the problem: > > None of the following Id generator classes > <generator class="identity" /> > <generator class="native" /> > > allows inserting into updatable view. Updatable view (more precisely > database server) takes care of assigning id. > Each time I get "Null id" (or is it "Null identifier" ) thrown from > ISession.SaveOrUpdate method. > While, on the other hand, same scenario with inserting into table > works perfectly. > > On database everything is tested to work. > NHibernate version is 3.2.0.4000 > > What is correct way to setup NHibernate to allow inserting into a view > without providing value for whatever field is set as Id? > > I would like to use NHibernate for an application with intensive usage > of views and stored procedures. > Now, I know you probably don't like usage of updatable views, and I > would not like to get into discussion on why do I use them, I simply > need to use them - if I'm gonna use any ORM framework as there is no > painless way to just use stored procedures (I mean in any ORM in any > technology I came across so far). > > Thanks in advance for helping. > > - Sofija > > On Friday, 16 March 2012 23:03:59 UTC, Sofija Blazevski wrote: > > Hello, everyone! > > I'm new to NHibernate, and I would like to use it together with > FluentNHibernate. > I've been trying to use them together for an updatable view scenario. > > This is the problem: > > None of the following Id generator classes > <generator class="identity" /> > <generator class="native" /> > > allows inserting into updatable view. Updatable view (more precisely > database server) takes care of assigning id. > Each time I get "Null id" (or is it "Null identifier" ) thrown from > ISession.SaveOrUpdate method. > While, on the other hand, same scenario with inserting into table > works perfectly. > > On database everything is tested to work. > NHibernate version is 3.2.0.4000 > > What is correct way to setup NHibernate to allow inserting into a view > without providing value for whatever field is set as Id? > > I would like to use NHibernate for an application with intensive usage > of views and stored procedures. > Now, I know you probably don't like usage of updatable views, and I > would not like to get into discussion on why do I use them, I simply > need to use them - if I'm gonna use any ORM framework as there is no > painless way to just use stored procedures (I mean in any ORM in any > technology I came across so far). > > Thanks in advance for helping. > > - Sofija > > On Friday, 16 March 2012 23:03:59 UTC, Sofija Blazevski wrote: > > Hello, everyone! > > I'm new to NHibernate, and I would like to use it together with > FluentNHibernate. > I've been trying to use them together for an updatable view scenario. > > This is the problem: > > None of the following Id generator classes > <generator class="identity" /> > <generator class="native" /> > > allows inserting into updatable view. Updatable view (more precisely > database server) takes care of assigning id. > Each time I get "Null id" (or is it "Null identifier" ) thrown from > ISession.SaveOrUpdate method. > While, on the other hand, same scenario with inserting into table > works perfectly. > > On database everything is tested to work. > NHibernate version is 3.2.0.4000 > > What is correct way to setup NHibernate to allow inserting into a view > without providing value for whatever field is set as Id? > > I would like to use NHibernate for an application with intensive usage > of views and stored procedures. > Now, I know you probably don't like usage of updatable views, and I > would not like to get into discussion on why do I use them, I simply > need to use them - if I'm gonna use any ORM framework as there is no > painless way to just use stored procedures (I mean in any ORM in any > technology I came across so far). > > Thanks in advance for helping. > > - Sofija > > On Friday, 16 March 2012 23:03:59 UTC, Sofija Blazevski wrote: > > Hello, everyone! > > I'm new to NHibernate, and I would like to use it together with > FluentNHibernate. > I've been trying to use them together for an updatable view scenario. > > This is the problem: > > None of the following Id generator classes > <generator class="identity" /> > <generator class="native" /> > > allows inserting into updatable view. Updatable view (more precisely > database server) takes care of assigning id. > Each time I get "Null id" (or is it "Null identifier" ) thrown from > ISession.SaveOrUpdate method. > While, on the other hand, same scenario with inserting into table > works perfectly. > > On database everything is tested to work. > NHibernate version is 3.2.0.4000 > > What is correct way to setup NHibernate to allow inserting into a view > without providing value for whatever field is set as Id? > > I would like to use NHibernate for an application with intensive usage > of views and stored procedures. > Now, I know you probably don't like usage of updatable views, and I > would not like to get into discussion on why do I use them, I simply > need to use them - if I'm gonna use any ORM framework as there is no > painless way to just use stored procedures (I mean in any ORM in any > technology I came across so far). > > Thanks in advance for helping. > > - Sofija > > On Friday, 16 March 2012 23:03:59 UTC, Sofija Blazevski wrote: > > Hello, everyone! > > I'm new to NHibernate, and I would like to use it together with > FluentNHibernate. > I've been trying to use them together for an updatable view scenario. > > This is the problem: > > None of the following Id generator classes > <generator class="identity" /> > <generator class="native" /> > > allows inserting into updatable view. Updatable view (more precisely > database server) takes care of assigning id. > Each time I get "Null id" (or is it "Null identifier" ) thrown from > ISession.SaveOrUpdate method. > While, on the other hand, same scenario with inserting into table > works perfectly. > > On database everything is tested to work. > NHibernate version is 3.2.0.4000 > > What is correct way to setup NHibernate to allow inserting into a view > without providing value for whatever field is set as Id? > > I would like to use NHibernate for an application with intensive usage > of views and stored procedures. > Now, I know you probably don't like usage of updatable views, and I > would not like to get into discussion on why do I use them, I simply > need to use them - if I'm gonna use any ORM framework as there is no > painless way to just use stored procedures (I mean in any ORM in any > technology I came across so far). > > Thanks in advance for helping. > > - Sofija > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/adcvCTijXQYJ. 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.
