Hibernate with Spring Experts required.
Posted on 2005-04-14
I am using spring over hibernate. When i defined my objects (model objects/POJO's whatever) i have an equals, hashcodebuilder etc., defined for them using commons package helper classes.
I defined the relationships using hibernate XDoclet tags.
When i am trying to access the one-to-many (many part) of a relation in a jsp it gives lazy initialization exception. Ex : Cat, Kittens (1 cat many kittens).
I have getKittens() in my Cat Object definition obviously. So, in my jsp when i am trying to access this collection that exception is thrown. I have the open session in view filter and all required for spring.
When i removed the equals, Hashcode builder etc., from the objects, this works, i wonder why !!! Can anyone tell me why this is an obstacle for Hibernates lazy initialization using spring ??