Page 1 of 1

Auto Generated Value is not available in Delphi

Posted: Mon 24 Apr 2017 23:36
by davidizadar
According to EntityDAC's help file, it is possible to define Entity Keys which can be auto-generated by the underlying database. It is a good feature because in databases like Oracle it is necessary to define a sequence and create a trigger for assigning sequence values to the primary key.
I'm using SQL Server 2016 and the option to enable this particular feature for my Entity Keys is just missing in action.
I tried defining the primary key in the database as IDENTITY and synchronized the model from the database. The Entity Key was showing the correct SQL type (ID NOT NULL IDENTITY), but it was lost the next time I updated the database from the model.
I assume that this is just a regression bug.

Re: Auto Generated Value is not available in Delphi

Posted: Thu 27 Apr 2017 17:55
by davidizadar
No one answered, but I found the answer.
The property Auto Generate Value is not shown and updating from the database only updates the SQL type to NOT NULL IDENTITY.
But I found that it is possible to define the field property IdGenerator to Identity in the property dialog shown to the left bottom in Entity Developer.

Re: Auto Generated Value is not available in Delphi

Posted: Wed 17 May 2017 07:21
by AlexP
Hello,

The field type, as well as the Entity Key attribute is determined from the database, you should determine the behavior for generating keys in the model by yourself by selecting the generator type using the IdGenerator property