• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate SQL query column alias

 
Gina vernon
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there anyway to provide column aliases in hibernate, such as:




From the documentation it seems that only placeholders for column aliases can be provided and Hibernate then provides its own aliases. Is my understanding right?

Thanks.
 
Henrique Ordine
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can, but if A is a column in the Table table, then you need to do something like this:

Select t.A as B from table as t
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!