Creating New Instances of Imported Class with Identity Column

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”.

In a related topic (https://www.cuba-platform.com/discuss/t/identity_insert-when-create-new-entity-in-mssql) the suggestion was to switch to BaseIdentityIdEntity, but that option doesn’t appear for this class.

I’d like to create new instances of this class. It seems I need to change the parent class, but I cannot. How can I remedy this situation?

EDIT:
Attached the DDL (autogenerated with DataGrip) for the table in question. Column “ID” was generated by Cuba.Platform.

mtran.ddl.txt (545B)

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.

Thanks for your assistance!

Drop the PK-constraint and you will be able to delete the ID column.