Using Hibernate 3.0 final against PostgreSQL and Oracle. Here's the stack trace:
Code:
org.hibernate.hql.ast.QuerySyntaxError: expecting CLOSE, found '+' near line 1, column 161
[select
ss.id.sku.sizeCode,
ss.id.sku.sizeName,
sum( ss.endOfPeriod.units.thisWeek ),
sum( ss.inTransit.units.thisWeek ),
sum( ss.sales.units.thisWeek
+ ss.sales.units.oneWeekAgo
+ ss.sales.units.twoWeeksAgo
+ ss.sales.units.threeWeeksAgo),
sum( ss.sales.units.lifeToDate),
sum( ss.receipts.units.lifeToDate),
sum( ss.transfers.units.lifeToDate),
sum( ss.adjustments.units.lifeToDate),
sum( ss.replenishmentMinUnits),
sum( ss.replenishmentMaxUnits),
min( ss.replenishmentStartDate),
max( ss.replenishmentEndDate)
from
com.fgl.stylecard.model.SkuStore as ss
inner join ss.id.sku as sku
where
sku.styleNumber = :styleNumber
group by
ss.id.sku.sizeCode,
ss.id.sku.sizeName,
ss.id.sku.sizeCode
order by
ss.id.sku.sizeCode]
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:215)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
It looks like it's complaining about the sum( propertyA + propertyB) expression. This worked in Hibernate 2.1.x.