Help with database

Help with database

  


In an aggregate "X" in sources I added another aggregate "Y" that aggregate Y has data in its database, but in the sources nothing appears.

In this image I have the database called ComposicaoVidro



When adding in sources

They are all zeroed
As in the picture above

Hi Rafael,

I see that you have a "With or Without" join between the PedidoItem and ComposicaoVidro entities. It may be the case that you have values in the PedidoItem entity where PedidoItem.ComposicaoVidroId is not set or it has a value that does not exist in the ComposicaoVidro entity.

In order to check that, can you please make the id attributes visible (by clicking in the small blue numbered markers with numbers) and then take another screenshot of the aggregate's editor? I'd like to see the values for the PedidoItem.ComposicaoVidroId and ComposicaoVidro.Id columns.


Thanks!


Hi, is it?

Hi,

Yes, looking at the screenshot we can see that PedidoItem.ComposicaoVidroId is not set (i.e., it is NULL) in any of the visible lines. Please note that we see a zero instead of NULL (or an empty cell) because the OutSystems language has no concept of NULL, so a null identifier is represented, in memory, by a zero.

Since you're using a "With or Without" join, this means that we want to preserve all rows from the first entity (PedidoItem) even if there's no match in the second entity (ComposicaoVidro). Whenever there's no match you get default values for the attributes in the second entity. That's the reason why you see all those zeroes.

I hope this helps!