Entity identifier's datatype explanation

Hello,

Can someone please explain me the context below?


What does the "NOTE" part means?

Regards,

Indranil

Solution

Hi Indranil,

In the database, the underlying data type of the Entity Identifier will be one of the three types possible: Integer, Long Integer or Text. 

This means that an Entity can have a primary key that will hold a number (integer or long integer) or a text, as its value. 

If the Identifier is numeric (integer or long integer), and AutoNumber, this means that you don't have to worry about giving a unique identifier value when you create a new record. The database will take care of it for you. The first record will receive as Identifier value the number 1, then 2 and so on. 

If the Identifier is NOT AutoNumber (including if it has a data type Text), when you create a new record, you have to provide a valid value for the identifier (one that does not exists yet in the table).

But inside the platform, an Entity Identifier is treated as a Data Type itself (despite being an integer, long integer or text). This makes easier for the platform to deal with identifiers and foreign keys/variables that must store a valid identifier because it can determine if you are putting or comparing the right things.

And this means (than the NOTE there), that a primary key's data type can be also another Entity Identifier (becoming both a Primary Key and a Foreign Key). In this case, the "underlying" data type of this entity identifier will be the same as the other entity. If the other is integer this one will also be an integer, if it is text, this one will be text as well.

If I was not clear enough, let me know.

Cheers!

Solution

Eduardo Jauch wrote:

Hi Indranil,

In the database, the underlying data type of the Entity Identifier will be one of the three types possible: Integer, Long Integer or Text. 

This means that an Entity can have a primary key that will hold a number (integer or long integer) or a text, as its value. 

If the Identifier is numeric (integer or long integer), and AutoNumber, this means that you don't have to worry about giving a unique identifier value when you create a new record. The database will take care of it for you. The first record will receive as Identifier value the number 1, then 2 and so on. 

If the Identifier is NOT AutoNumber (including if it has a data type Text), when you create a new record, you have to provide a valid value for the identifier (one that does not exists yet in the table).

But inside the platform, an Entity Identifier is treated as a Data Type itself (despite being an integer, long integer or text). This makes easier for the platform to deal with identifiers and foreign keys/variables that must store a valid identifier because it can determine if you are putting or comparing the right things.

And this means (than the NOTE there), that a primary key's data type can be also another Entity Identifier (becoming both a Primary Key and a Foreign Key). In this case, the "underlying" data type of this entity identifier will be the same as the other entity. If the other is integer this one will also be an integer, if it is text, this one will be text as well.

If I was not clear enough, let me know.

Cheers!

Hello Eduardo,

Thank you so much for such a crisp and clear explanation.Its much clear to me now.

Regards,

Indranil