ObjectDB ObjectDB

Issue #637: Alias not used in ORDER BY

Type: Bug ReoprtPriority: LowStatus: FixedReplies: 2
#1

Hi,

I am doing something simple like

final Root<T> from = criteria.from(T.class)
final Path<?> path = from.get("someStringProperty")
final Expression<String> upperPath = builder.upper((Expression<String>) path);
upperPath.alias("TEST");
criteria.multiselect(from, path);
criteria.orderBy(builder.asc(upperPath))

I would have expected the alias to be used in the ORDER BY clause, something like

SELECT $1, UPPER($1.someStringProperty) AS TEST FROM T ORDER BY TEST

However what I actually get as query string is

SELECT $1, UPPER($1.someStringProperty) AS TEST FROM T ORDER BY UPPER($1.someStringProperty)

This doesn't seem right to me..

Alex

edit
delete
#2

These queries are equivalent, but it will be fixed to make toString of criteria query more friendly.

ObjectDB Support
edit
delete
#3

Fixed in build  2.3.6_07.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.