Hi,
I am curious to know what's the difference between entities and static entities identifiers data types?
like why static entities' IDs » Data type » Integer?
and entities' IDs » Data type » long integer?
Thank you in advance,
Best regards
Hi Azhar,
Static entities, as the name suggests, are for entities that change much, whose records don't change at run time. It is the equivalent to the enumerators in other programming languages and are commonly used for a limited domain of possibilities. Given this limited range, an integer is more than enough to serve as the id, although the static entity is can be anything.
As for the other entities, they can receive all kinds of data whose records might reach millions that overcome the maximum limit of an integer, hence the long integer which increases this limit.
Kind regards,
João
Thank you João!
Hello
Data types are by default to Integer in Static Entity and Long Integer in transactional Entity. However, you can change it in both of the entities from the property section of the Id attribute.
In Static entity, we only store data that we cannot change on runtime. Some examples like Dropdown which show us Prefix like, Genders: Male, Female, Other.The Content is static and hence it can be limited and we are not creating millions or trillions of records here, so why take the long integer and allocate more space when we can take Integer and it will allocate less space
The short data type takes 2 bytes of storage space; int takes 2 or 4 bytes, and long takes 8 bytes
You can also check this link to have details on datatypes in OutSystemshttps://success.outsystems.com/documentation/11/reference/outsystems_language/data/data_types/available_data_types/Thanks & RegardsTousif Khan
Thank you Tousif!
Great answers! Thanks!