Archives for: October 2008

How can I do lazy loading with a one-to-one relationship in hibernate?

October 26th, 2008
I struggled for ages trying to figure out how to do lazy loading on a one-to-one relationship in hibernate. I'll put you out of your misery now - you can't! I have one central table and 2 one-to-one relationship tables hanging off it. When the prim… more »

Mantis Issue Tracker's Bugnote Links

October 25th, 2008
Mantis Bug Tracker is an open source bug and issue tracker. We use it here to help track work requested by our customers. I wrote the time tracking and billing section, which is one of my claims to fame! When a customer creates an issue on the system,… more »

LazyInitializationException, Spring, Hibernate and JUnit Nightmere

October 15th, 2008
When using hibernate inside a container like Tomcat or JBoss the transaction manager is set up as part of the container's configuration. The container handles the transaction synchronisation and tells the application when to start and stop the transactio… more »

Spring JUnit test to assert test for exceptions

October 14th, 2008
When writing unit tests you often need to check to see if a method throws a particular type of exception under a particular set of conditions. In the package org.springframework.test there is a handy helper class to help you do this. new AssertThrows… more »