I’m rewrite old application on Cuba Platform. My entity Client have auto increment ID (IDENTITY FIELD) in MSSQL Database. When I edit entity - all works OK.
But when I try to create new entity then receive SQL error:
SQLException: Cannot insert explicit value for identity column in table ‘Clients’ when IDENTITY_INSERT is set to OFF.
How to solve this problem?
Can I add “SET IDENTITY_INSERT sometableWithIdentity ON” in transaction?
And how to control selection if identity ID number?
Great. You could also use an entity with IDENTITY primary key. It is available in the Id type drop-down in the New entity dialog. The base class of your entity will be BaseIdentityIdEntity in this case.