Could please provide me a solution, how to use Arithmetic operations in Projections,
current code:
---------------------
.add( Projections.sum("broker.total"), "total" )
Expecting
--------------------
.add( Projections.sum("broker.total") * 100/2, "total" )
the other way is, we can use :
.add( Projections.sqlProjection( "((sum({alias}.percentage)*100)/" + bgTotalPercentage + ") as percentage ", new String[] { "percentage"},new Type[] { Hibernate.BIG_DECIMAL} ))
I dont want to give databse column name in the java code, is the possibe to use object name inside sqlProjections.
|