Hello,
I've just made a Filter that needs to check only the first result of a subquery:
Code:
@Filter(
name = "dataPrevisaoMaiorQue",
condition = ":dataPrevisaoMinima <= (select first 1 coalesce(PC.DATA_PREV, CURRENT_DATE) " +
"from PEDIDO PC " +
"where PC.ID_DI = ID_DI " +
"order by PC.DATA_PREV desc)"
)
The problem is that "first" and "CURRENT_DATE" are reserved keywords and hibernate is prefixing them with this_., and because of this prefix the db throws a "token unknow". This is the result sql generated by hibernate:
Code:
:dataPrevisaoMaiorQue.dataPrevisaoMinima >= (select this_.first 1 coalesce(PC.DATA_PREV, this_.CURRENT_DATE) from PEDIDO PC where PC.ID_DI = this_.ID_DI order by PC.DATA_PREV desc)
I'm using Firebird 2.1 and Hibernate 3.3.1. How could I tell to hibernate to no prefix the reserved keywords? Is this a bug?
Regards,