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.
Auto Generated Value is not available in Delphi
-
- Posts: 4
- Joined: Thu 20 Apr 2017 19:44
-
- Posts: 4
- Joined: Thu 20 Apr 2017 19:44
Re: Auto Generated Value is not available in Delphi
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.
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
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
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