Table where Primary key column is of type Integer

Hi,

is there any way to support modelling the table where Primary Key column type is integer?

What I am trying to achieve

  1. I have created table in test model repository:

    obrazek

  2. I have rendered Menu item with screen and screen section

  3. I have setup Default template to make sure the Id is not null

  4. I opened the screen inside Origam Client
    obrazek

Everything works fine until I try to save record.

I expect

New record is saved.

What I get

  1. I get error 400
    obrazek
  2. Inside network tracing I see this error:
    obrazek

Additional notes

In the code, there is class Update Data rowId typed to UniqueIdentifier which is causing an error:

    public class UpdateData
    {
        public Guid RowId { get; set; }
        public Dictionary<string, object> Values { get; set; }
    }

There are probably much more limitations regarding UniqueIdentifiers inside Origam server code. I found out for examle DataAuditLog that is completely dependant on UniqueIdentifier Id.

Why I would like to know how to model the scenario

I have existing database table where primary key column’s type is integer, I would like to allow user to edit the data inside Origam without modifying the table. Is there any way how to achieve working model with Integer primary key column?

The only way I imagine is:

  1. Add new additional column into an entity, i.e. GuidId as UniqueIdentifier
  2. Initialize column with guids, i.e. using cast(FORMAT(Id, '00000000-0000-0000-0000-000000000000') as UNIQUEIDENTIFIER)
  3. Make sure that the column is always correctly filled in.

Do you have any tips or it is considered as Origam’s limitation?

I added pull request where entity is modeled:

Can be merged just to temporary branch and deleted when considered as not needed.

We classify this as a bug.

1 Like

New model added into master branch: