static entities and their id

static entities and their id

  
Hi,

by default a static-entity got the id as an autonumber.
Why is that so, this means that static-entities over different servers will have a different id possible, I don't like the thought of that:

Now I have to synchronize some data between 2 servers.
This is causing issues because of the static entities (which was unexpected btw)

if I changed the id to a non-autonumber, will the current id's stay, or they become obsolete and effectively destroy the integrity in my database?


thanks in advance,

Joost
Joost, A static entity is much like a standard entity, (maybe with some cache) it means when you create a static entity it's going to create a table in your database, just like a standard entity. If you manually input the identity key, the values you assign to it will always stay the same.
I understand is works like a normal entity, but what is the point of being static then, except in design mode.

Imho it's semi-static, because you cannot count on the id's being the same in every database you are publishing those statics.

II have a workaround for it, but not happpy about static entities not being static :)
Joost Landgraf wrote:
I understand is works like a normal entity, but what is the point of being static then, except in design mode.

Imho it's semi-static, because you cannot count on the id's being the same in every database you are publishing those statics.

II have a workaround for it, but not happpy about static entities not being static :)
 
Good point, Joost.

Static entities should have the IsAutoNumber set to "No" by default.
It's definitely an interesting idea/behaviour to post at the "Wisdom of Crowds".
It would have my vote.

Regards.
Joost I believe it works the way it does so thay you could easily convert, between entity and static entity!
I guess the trick is as Robert says is to switch off 'Is AutoNumber' and assign yourself the id as you could get in a real mess between environments over time.

(Frustrated as I can't set a Default Value on an entity that refences a static entity, hence looking around this area. Not too frustrated thou as I am enjoying the data modeller)

Hi Folks, 

Just curious, since this thread has been open for quite a number of years, has there been any changes to outsystems since then to improve this situation?

Hi Caulibeam,

The default in statics entities is still to be auto number and the id can be different in every environment. I always change this setting IsAutoNumber to No. This way i need to set the id's myself but they are the same in all the environments.

Regards,

Marcelo

Hi, there are four ways to use this static entity:

1. change the id to type text - so you now create a natural key, instead of synthetic key (auto number)

2. set autonumber off - as suggested above

3. use as is - default autoincrement

4. back door - find physical table relating to that entity, say it ossyss_entity_record, sequence_table, etc

regards