Posts

Showing posts with the label groovy

Boost your Groovy with NailGun

Boost your Groovy with NailGun Are you working on a large Hibernate project that takes long time to load up all the hbm.xml files when creating the Session object? This is fine during deployment and runtime because it only loads it once. However, often time we also need to the same Session object to do some ad-hoc HQL queries to debug or validate data. Loading and re-loading large mapping files in a Session to just execute single query is very painful. Now, I like to poke around Java things with Groovy , and its a great tool to peek at your data as ad-hoc queries as well. You can easily do this with their groovyConsole GUI tool and add --classpath option to include your project classes. This will bring up a tiny Editor, and you can script to load your hibernate Session there. Once the first run is loaded (the hibenrate Session created), then second run is almost in an instant. Running the little groovyConsole had wet my appetite, and I was hungry for a better text editor, b...