Hi.
I need to execute a query with NVL or COALESCE like
Code:
Select NVL(sum(cantidad),0) as cantidad .....
I'm currently doing the following code
Code:
DetachedCriteria criteria = DetachedCriteria.forClass(Inventario.class);
criteria.setProjection(Projections.alias(Projections.sum("cantidad"), "cantidad"));
...
I can get a right value ( != null ) or a null value, so when is null, an Exception occurs because "cantidad" is a primitive attribute (it's a NotNull column).
How can I get this on Hibernate ??
thks.