Legal Entity Id Section
The data from the Legal Entity Id (LEI) section (complex node legalEntityId) of EagleML message are loaded into SECURITYDBO.LEI_DETAILS DB table.
Insert Entity
If the new Entity is loaded into Entity DB tables, the data will be inserted into SECURITYDBO.LEI_DETAILS DB table if the element Legal Entity Id is not null in the incoming message and it does not exist in LEI DB table.
In other case the existing table with specified Legal Entity Id will be updated by the values of incoming message. The update occurs in two stages:
delete the record from DB table
insert the record with specified LEI value
Update Entity
When the Entity Id is updating, the new Legal Entity Id also could be inserted into LEI DB table if it does not exists or updated in other case.
If the new Legal Entity Id was specified in the incoming message, the new row will be inserted into LEI DB table and the ENTITY DB table will refer to it. The relationship to old LEI record will be deleted, but the record will not be deleted from the LEI DB table.