Page 1 of 1

StoreGeneratedPattern="Identity" is removed from edml

Posted: Wed 02 Nov 2011 21:13
by dm3sol
StoreGeneratedPattern="Identity" was removed from the edml after updating the model from the database. I had entered StoreGeneratedPattern="Identity" for each entity manually.

I use an Oracle database with triggers and sequences to populate PKs for new records.

I am using 4.1.55 version of Entity Developer. I've read somewhere on your web site that this has been fixed.

Any ideas how to preserve the StoreGeneratedPattern="Identity" in the model?

Posted: Thu 03 Nov 2011 13:34
by StanislavK
As Oracle does not provide a specific keyword that makes a column auto-incremented, Entity Developer has to check the existence of a trigger that sets the primary key upon inserting a new row. However, it cannot determine what exactly is done by each particular trigger. So, Entity Developer cannot rely on user-defined triggers, and searches for the trigger and sequence with specific names (precisely, "AI$[table name]" and "AI$[table name]_[column name]_seq"). If they are available in the database, the StoreGeneratedPattern is set to 'Identity' for the column. Otherwise, it is not.

If you set the StoreGeneratedPattern property to Identity for a field, Entity Developer creates such trigger and sequence for the corresponding column when you run the 'Update Database from Model' wizard.

Feel free to contact us if anything is unclear.

Posted: Thu 03 Nov 2011 16:15
by dm3sol
Thanks for reply!

I gather that it is not possible for me to change the "AI$[table name]" or "AI$[table name]_[column name]_seq" within the Entity Developer?

Posted: Fri 04 Nov 2011 16:16
by StanislavK
Yes, it is not possible to change the names of the trigger and sequence used for ID generation.

However, we plan to change the 'Update Model from Database' wizard behaviour so that the 'Identity' store generation pattern is not reset. For more information about this change, please refer to the following topic:
http://www.devart.com/forums/viewtopic.php?t=22345

Posted: Wed 21 Dec 2011 08:06
by bandit
dm3sol wrote:Thanks for reply!

I gather that it is not possible for me to change the "AI$[table name]" or "AI$[table name]_[column name]_seq" within the Entity Developer?
Same problem. Create synonyms for trigger and sequences did it.

Posted: Fri 23 Dec 2011 14:21
by Shalex
Please rename triggers (without creating synonyms).