I\'m using spring 4.0.5 and hibernate 4.3.5; I\'m facing an error with hibernate and I can\'t figure where I\'m wrong (because I\'m sure I\'m wrong). I have a table related
If you have @OneToOne
mapping in your class then update the fetch type to LAZY.
Because by default fetch type for OneToOne is EAGER so when we fetch object of main class (WebTree) class, it will fetch the object for OneToOne mapped class so when hibernate map the object it will throw the exception.
In Short if you have OneToOne Mapping then replace it with @OneToOne(fetch = FetchType.LAZY)
.