Edited by OutSystems on March 21, 2014 The feature described in this topic is not formally supported by OutSystems. OutSystems advises against using this feature, as it may lead to unexpected results. Customers should not expect any official support from use of this feature.
Since version 3.2, it's possible in the OutSystems Platform to configure the physical table name used to support Entities on the database.
Up until now, physical table names were in the form of OSUSR_<ESPACE_ID>_ENTITYNAME, where <ESPACE_ID> stands for an internal eSpace identifier. For example, an Entity named Client contained inside an eSpace with identifier 112 would have a physical table name of OSUSR_112_CLIENT.
This format presented some challenges :
- Because the eSpace identifier changed between environments (development, testing, production, etc), it was difficult to make direct connections to tables. This made external integrations difficult to achieve;
- It could be a difficult format to read, because long entity names would be truncated;
To alleviate this problem, version 3.2 now provides a configuration setting that can be used to specify one of three table name formats. This setting is called Compiler.DefaultPhysicalTableName and can be found in the file OSHEComp.exe.config, on your Hub Server installation folder root. Valid entries for this setting are :
- PREFIX_ESPACENAMEHASH_ENTITYNAME - This format uses the OutSystems prefix (OSUSR) followed by a hash of the eSpace name. The hash is unique for each eSpace name and will remain constant in different environments so it is safe to assume that the physical table name will also be equal. This is now the the default Hub Server mode.
- PREFIX_ESPACEID_ENTITYNAME - Equivalent to the old format, where the OutSystems prefix is followed by the internal eSpace identifier and the entity name.
- ENTITYNAME - This format was designed to be used in very particular situations where the name of the database tables is relevant outside the OutSystems Hub Server environment. For example, it can be useful if you wish to establish a Data Dictionary that is also available to third party tools and direct integrations. Also, it is easier to read and understand when accessing the database from external query tools (for example Query Analyzer). However, please note that this setting can pose security issues, because the OutSystems Hub Server will not be able to make run-time checks on table access. This means that, for example, Advanced Queries will be able to access tables from other eSpaces directly by just referring to it's physical table name.
You will need to restart OutSystems Services in order to apply the new settings.
As a final note, please remember that changes made to this setting will only affect Entities created from that moment on. This means that if you publish an already existent eSpace any Entities that already existed will keep their original table names. However, if you create new entities, these will be affected by the new value for this setting.