StoreGeneratedPattern="Identity" is removed from edml

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
dm3sol
Posts: 6
Joined: Tue 11 May 2010 08:46

StoreGeneratedPattern="Identity" is removed from edml

Post by dm3sol » Wed 02 Nov 2011 21:13

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?

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 03 Nov 2011 13:34

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.

dm3sol
Posts: 6
Joined: Tue 11 May 2010 08:46

Post by dm3sol » Thu 03 Nov 2011 16:15

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?

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 04 Nov 2011 16:16

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

bandit
Posts: 1
Joined: Wed 21 Dec 2011 07:51

Post by bandit » Wed 21 Dec 2011 08:06

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.

Shalex
Site Admin
Posts: 8242
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 23 Dec 2011 14:21

Please rename triggers (without creating synonyms).

Post Reply