[ Content | Sidebar ]

Posts tagged Java

Assertions in Java

It was not until recently that I found this feature of the Java language. Runtime assertions, which can be enabled or disabled with JVM arguments, and derive in errors if failed. Such a feature can be very helpful in building quality Classes. In some way, when enabled, every object built with assertions in its code [...]

Hibernate: scrolling through entities with join fetched child collections

While this should be a trivial thing, only consisting of mapping your entity and requesting a ScrollableResults from a Query object, it recently proved quite harder for me and my colleagues. The symptoms you may see if ever using this approach are very confusing: child collections will most of the time have only one entity, [...]