Wrong atribute name in Executed SQL


Hello all,
i'm having an issue with the platform that i actually can't understand.

I created the following entity and published:

EntityA: Atribute1 (pk); Atribute2; Atribute3;...

After that i created a new atribute and defined as primary key.

EntityA: Atribute4 (pk); Atribute1 ; Atribute2; Atribute3;...

A basic example is when i create a simple advance query:

SELECT [EntityA].[Atribute4] 
FROM  [EntityA]

in the Executed SQL i get 

SELECT [EntityA].[Atribute1] 
FROM  [EntityA]

This issue occurs only in consumer eSpaces. In producer there's no problem at all.
Can anyone help me with this issue? I would like to understand what is going on to prevent future issues.

Kind Regards,

Hi Guilherme,

Remove this entity and create a new one.Sometime it gives you problem when you have the primary key referred some where and has data in entity .



Also, please make sure you're enclosing your entiy and attribute names correctly:

Where you have:

SELECT [EntityA].[Atribute4] FROM  [EntityA]

It should be:

SELECT {EntityA}.[Atribute1] FROM  {EntityA}

Refer here for more:



Thank you for your replies. 

The problem will be solved with a re-creation of the entity indeed, but i would like to understand why this happens.

The compiled code of the entity (\share\full\Entities.ENEntityAEntityRecord.cs) in the producer is fine but the same file in consumer is not.

return new System.Collections.Generic.Dictionary<string,string>() {{"Atribute4", "Atribute1"}, {"Atribute1", "Atribute1"}, {"Atribute2", "Atribute2"},....

That is, in service studio if you simply use {EntityA}.[Atribute4] in a query, it will consider {EntityA}.[Atribute1] and obviously, will return different results. 

Is there anything that i can do to correct this situation without cut-paste the entity?

Cheers, Guilherme