Bug 31 : Column Alias not used in raw sql select... uses rsmd.getColumnName()
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
0.9.5
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
30/01/2008
Updated 
30/01/2008
Type 
Bug
 
Attachments 
No attachments

In using a FindByNativeSql with a sql select statement that uses column alias.

select order_id, sum(...) as total
...

The "as total" is a column alias, and that is not being used.

So to fix, in....

com.avaje.ebean.server.find.FinderNativeSql.getPropertyNames()

...
String columnName = rsmd.getColumnName( index);

should be....

String columnName = rsmd.getColumnLabel( index);

 
Rob 07 Feb 09:41
Fixed 0.9.5

fixed.

woResponse

Upload a file