Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.3
Name and version of the database you are using:
PostgreSQL8.0
Hi
I have a SQL query with
case when
i.e).
"select field_1,field_2,field_3,field_4,sum(case when transaction_type = 'Purchase Return' then -1*actual_quantity when transaction_type = 'Sale Order' then -1*actual_quantity else actual_quantity end) from inventory_transaction_stock_view group by field_1,field_2,field_3,field_4"
I want to write an hql query for the above sql can anyone help me on this.
I can write an hql without case and it works properly
i.e)
"select info.fieldone,info.fieldtwo,info.fieldthree,info.fieldfour,sum(info.actualquantity) from InventoryTransStockViewInfo info group by info.fieldone,info.fieldtwo,info.fieldthree,info.fieldfour"
How do i use case when in the above HQL?
I have also tried with Criteria couldn't find a solutionf for "case when" Query