Sequence Attribute seems to require cpDontInsert to be added to the ID Column definition

Issue #68 closed
Todd Flora created an issue

When using the [Sequence] Entity level attribute, the ID column was being added twice to the insert statement causing Oracle to fail with a duplicate field name error.

So for instance I have the following partial class definition

  [Sequence('Select GetSid as Sid from dual')]
  TPubSubscriber = class
  private
    [Column('SID',[cpRequired,cpPrimaryKey,cpNotNull ],19,0)]
    FSid: Int64;

I had to change the Column attribute as follows in order to get the insert statement to only add the Sid column once.

private
    [Column('SID',[cpRequired,cpPrimaryKey,cpDontInsert,cpDontUpdate,cpNotNull ],19,0)]
    FSid: Int64;

I am unsure if this was the right thing to do or if the Insert Sql builder code should look for the ID column before inserting it again when the Sequence attribute is found. At a minimum this should probably be considered a documentation issue for the Sequence attribute documentation explaining that the cpDontInsert column property should be added to the ID column attribute definition.

Comments (2)

  1. Log in to comment