I have an imported table from MSSQL that was set to extend BaseUuidEntity. Now, when I’m trying to create a new entity of this class via EntityManager, the system is telling me that I “Cannot insert explicit value for identity column in table ‘<table_name>’ when IDENTITY_INSERT is set to off”.
Hi,
Which version of Studio and platform do you use?
It seems there was no PK constraint in the table and that is why Studio created the new PK during the model generation.
Try to remove the ID column, adjust PK and import the table again.
In 6.6.1 (Studio and platform) BaseIdentityIdEntity is generated for the table if the UID column is marked as PK,
I am currently using PL 6.6.1 and STUDIO 6.6.0, though I believe I added the table with PL 6.6.0.
Looking at the original schema for the table, the column is marked as IDENTITY, but not as a PK.
I dropped the table (couldn’t figure out how to remove column ID of type uniqueidentifier), added the PK constraint, reimported the table and generated the model for it, and it works now.