Skip to content

Hibernate join bug

03-Sep-09

Hibernate bug 1895 seems to be still there since 2006.
If, for instance, in Grails, such a syntax won’t work for you (it won’t):
def books = Book.findAll(“FROM Book AS b JOIN Chapter AS c WHERE c.active = :isActive”)
with a NullPointerException in “HqlSqlWalker.createFromJoinElement” — just use alternative join syntax, via WHERE:
def books = Book.executeQuery(“select b FROM Book [...]

Grails: mocking domain objects in unit tests

13-Jul-09

We’re trying Grails, Rails-like web application framework for Java.
It’s fine, just that Groovy debugger support is, er, imperfect, even in the best Gruoovy IDE – IDEA.
And, if you want to unit test, you won’t have fancy domain class methods addTo* – like Customer.addToOrders().
They’re generated by Grails on startup.
In order to have addTo*(), inherit from GrailsUnitTestCase [...]

Closures in mainstream languages

29-Aug-07

C# has closures, you know? A sample of how to use one.

Broken HTML parsing in Java

16-Aug-07

Given: HTML code, non-valid and non-well-formed.
Make it a well-formed XHTML, in Java.
We considered JTidy, but it’s source looked too messy and hacky. I looked for a parser that could correct XML – not in sense of schema, but correct any mistakes, and pass out a well-formed XML and error list.
I was able to find JTidy [...]