vaguely useful hack
This is one of the more useful hacks I’ve thrown together lately. It’s a simple console application for accessing a hibernate domain (i.e. you can execute queries such as “from Blah where x = 1″), so you don’t have to deploy your application to test minor changes to hql statements.
It is, by no means, an endorsement of hibernate; rather a reflection on the fact that I can’t find any tools to access the domain which don’t require the use of Eclipse (<sarcasm-alert>because, of course, everyone uses eclipse</sarcasm-alert>).
In any case, the script needs to be executed with a classpath referencing the hibernate jars, jython jars, your domain classes, and anything else hibernate & jython might need to access — I run it from within ant, but it could quite easily be executed from a shellscript.



Neat, reminds me a similar hack I did awhile ago using groovy (http://www.talios.com/spring__groovy__services.htm) which loaded up a spring context which (at the time of that post) connected up to a bunch of EJB session beans and imported them all as local variables, making for a nice wee scripting interface.
You’ve gotta love scripting languages for quick and dirty hacks…