IT Certificaions

Google Cloud Platform

Monday, July 15, 2013

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role

Errror: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role.......

Solution: Add lazy=false in your hbm file where you have declare collection...
Example:
<set name="hhResume" inverse="true" lazy="false">
            <key>
                <column name="UID" not-null="true" />
            </key>
            <one-to-many class="com.example.HhCandidate" />
        </set>