Small bug in hbncontainer

While working with hbncontainer I came across a bug which manifests itself when I run against MySQL. The following code, in the method size():

size = (Integer) getBaseCriteria().setProjection(
                    Projections.rowCount()).uniqueResult();

can cause problems, if the database returns the object as a Long (which MySQL does). So changing it to:

size = ((Number)getBaseCriteria().setProjection(
                    Projections.rowCount()).uniqueResult()).intValue();

solved the problem.

Hi!

Apparently it is just against some versions as we are using it with MySQL without issues. However I don’t see issues that your patch could cause. I released a new version with it right away.

http://vaadin.com/directory#addon/43

cheers,
matti