sqlite - intiger filed is always auto generated

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
dilbert
Posts: 68
Joined: Tue 28 Apr 2009 10:11

sqlite - intiger filed is always auto generated

Post by dilbert » Thu 06 Oct 2011 13:13

For Sqlite database a primary key field with type 'integer' is generated as 'Auto Generated Value' even if it hasn't 'autoincrement' attribute.

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

Post by StanislavK » Fri 07 Oct 2011 12:13

The point is that integer primary key is auto-generated in SQLite, regardless of whether the 'autoincrement' keyword is used or not:
http://www.sqlite.org/faq.html#q1

However, we plan to implement an option controlling this behaviour: if this option is enabled, the integer primary key will not be marked as auto-generated by default in the model. We will post here when the corresponding build is available. At the moment, you can clear the 'Auto Generated Value' check box manually to be able to insert custom values into integer primary key columns.

dilbert
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Post by dilbert » Fri 07 Oct 2011 13:04

I experienced this issue with child table when its (integer) primary key was also a foreign key. In that case it couldn't be 'auto generated'.

However, I understand why it is generated that way.
Thanks for your clarification.

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

Post by StanislavK » Mon 10 Oct 2011 13:22

Thank you for the clarification. We will change the behaviour for 'child' sides of one-to-one associations (so that they are no more marked as auto-generated).

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

Post by Shalex » Thu 27 Oct 2011 16:47

The option to set Store Generated Pattern to None for int primary keys will be added starting from the next version (not build) of Entity Developer. We will post here when it is released.

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

Post by Shalex » Fri 09 Dec 2011 16:51

New version of Entity Developer 4.2 is released!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=22845 .

Post Reply