Start a new topic
Answered

Primary Key Generation Using Semql

I'd like to ask a few questions about primary keys:


1. Once you choose a PK (primary key) generation method, is it impossible to change it later on?


2. I wanted to include the class name when creating the PK as shown below, but it seems I can't use the class name because it's metadata at the time of creation. Does anyone know how I can work around this?

SEMQL: 'CONCAT(SUBSTR(UPPER(ClassName),1,1), LPAD(SEM_NUMBER_TO_CHAR(LENGTH(ClassName)),2,'0'), SUBSTR(UPPER(ClassName),LENGTH(ClassName),LENGTH(ClassName))) || AUTO_INCREMENT()'


3. Is it possible to deploy multiple models to a single data source?


Best Answer

Hello Holly,


Here are a few elements regarding your questions:


1. Once you choose a PK (primary key) generation method, is it impossible to change it later on?

> Yes, it can be change, by right clicking on the entity, then alter entity.

> But please note that if done, the best practice would be to reprocess the records inside this entity so that every records has the same PK.


2. I wanted to include the class name when creating the PK as shown below, but it seems I can't use the class name because it's metadata at the time of creation. Does anyone know how I can work around this?

> When do you have this error? Because I tested this with an integration via authoring in the UI and it is working fine.

> If you want to dig on this error, feel free to open a ticket.


3. Is it possible to deploy multiple models to a single data source?

Even though there is no hard limit, it is not recommended to do so.

A data location is dedicated to one model edition at a time, as per mentioned in our documentation:

https://www.semarchy.com/doc/semarchy-xdm/xdm/latest/Manage/deploy/data-locations.html


Hope that helps.

1 Comment

Answer

Hello Holly,


Here are a few elements regarding your questions:


1. Once you choose a PK (primary key) generation method, is it impossible to change it later on?

> Yes, it can be change, by right clicking on the entity, then alter entity.

> But please note that if done, the best practice would be to reprocess the records inside this entity so that every records has the same PK.


2. I wanted to include the class name when creating the PK as shown below, but it seems I can't use the class name because it's metadata at the time of creation. Does anyone know how I can work around this?

> When do you have this error? Because I tested this with an integration via authoring in the UI and it is working fine.

> If you want to dig on this error, feel free to open a ticket.


3. Is it possible to deploy multiple models to a single data source?

Even though there is no hard limit, it is not recommended to do so.

A data location is dedicated to one model edition at a time, as per mentioned in our documentation:

https://www.semarchy.com/doc/semarchy-xdm/xdm/latest/Manage/deploy/data-locations.html


Hope that helps.

Login to post a comment