Bring back the CTRL + drag and drop entity

By André Ramos on 31 Jan 2013
In the 4.1 or 4.2 version of the platform we had a feature of dragging an entity to an advanced query while pressing the CTRL key, that would expand all it's fields when droped. It was a great feature.
Luís Lopes5 Feb 2013
what is the real value of this ?

J.8 Feb 2013
I'm curious as well.

do you mean that you instantly see in the edit field

{FOO}.Attribute1, {FOO}.Attribute2, {FOO}.AttributeN ?

so you can fix it faster?
André Ramos15 Feb 2013
There is more than one use case where this kind of fuctionality is useful.

This has more to do with entities that have many columns. Denormalized data for db performance for instance.

One use case is when you have columns that have been deleted and a simple {Entity}.* would make your query crash because you would be getting more columns that the ones referenced in the entity. And you can't always delete it from the database.

Another use case: you're doing an advanced query with a lot of columns to group by. With this functionality you could save a lot of work and time, and error-prone-ness by doing it automatically. 

It might not be used a lot but it's really helpful when you do need it. And since it was a feature that was already present, it's kind of hard to see it gone.

André Ramos15 Feb 2013
@Statler & Waldorf: no. With this functionality you would drag an entity to an advanced query, while pressing the CTRL key, and all of it's fields would appear.

For instance, if you have an entity named Entity1 with the columns Col1, Col2 and Col3, when you drop it inside the advanced query the result would be:
{Entity1}.[Col1], {Entity1}.[Col2], {Entity1}.[Col3].

Even more helpful would be to be able to select multiple columns and drag and drop them to the advanced query. Just like we can do with a single one.

Luís Lopes15 Feb 2013
Hi André. the {Entity}.* expands in runtime to {Entity}.A1, {Entity}.A2, {Entity}.An and doesn't matter if there are attributes on the database side.
The advantage of this syntax over the expanded one is that the query is more maintainable, and if someone alters the entity, it does not break the query.
André Ramos16 Feb 2013
Has that behaviour changed in recent releases? It was normal for a {Entity}.* query on a database table that has more columns than the ones referenced on the table to break the query.
André Ramos12 Mar 2013
I'm having a ORA-01791 error for an {Entity}.* distinct query with order by parameters in that entity. So I'm guessing that the parameters don't get expanded, otherwise this would not happen.

Luís Lopes12 Mar 2013
Hi André, the parameters are expanded.  You're  probably misinterpreting the ORA-01791. What it says is "The query is a SELECT DISTINCT query with an ORDER BY clause. In this context, all ORDER BY items must be constants" - reference
André Ramos13 Mar 2013
Well if the Oracle database is throwing that error when I'm doing an advanced query, with the following code: 
SELECT DISTINCT {Entity1}.* FROM {Entity1} ORDER BY {Entity1}.[Value1], and it's not throwing it when I put all the parameters that I want to output like SELECT DISTINCT {Entity1}.[Value1],  {Entity1}.[Value2] FROM {Entity1} ORDER BY  {Entity1}.[Value1]. How can the parameters be expanded? If they were shouldn't the database see the same query as the end result?
Luís Lopes13 Mar 2013
Hi André. Can you please report that problem to support, that behavior is not expected.
I could not reproduce the problem and I'm seeing the correct expansion.