JPQL query no longer working in CUBA 7

Hi, I have just migrated my project from CUBA 6 to 7 and some of my JPQL queries are no longer working. It seems I can no longer group by a formula. A query such as:

select e.product.id, count(1), e.amount / e.quantity
from demo$DirectSale e
group by e.product.id, e.amount / e.quantity

Now gives an error such as:

com.haulmont.cuba.core.sys.jpql.JpqlSyntaxException: Errors found for input jpql

I feel it should work since the SQL equivalent works:

select product_id, count(1), amount / quantity
from demo_direct_sale
group by product_id, amount / quantity

Perhaps this is dependent on a library leveraged by CUBA. I would appreciate it if someone could tell me if this should be possible or redirect me to a more appropriate site. Thanks.

I’m not sure why this change works but it works if you use an alias for the formula result. So this JPQL will work:

select e.product.id, count(1), e.amount / e.quantity as price
from demo$DirectSale e
group by e.product.id, price