Java Hibernate Lazy=false

Posted by Noor on Stack Overflow See other posts from Stack Overflow or by Noor
Published on 2011-01-02T16:50:14Z Indexed on 2011/01/02 16:53 UTC
Read the original article Hit count: 187

Filed under:
|

When setting Lazy=false, then hibernate will automatically loads the objects into the required sets e.g.

<set name="Options" table="ATTRIBUTEOPTION" inverse="false"  cascade="all" lazy="false">
        <key>
            <column name="ATTRIBUTEID" />
        </key>
        <one-to-many class="com.BiddingSystem.Models.AttributeOption" />
</set>

but if in my xml mapping, I place lazy=true and in some place in my application i decide that i want to load all attribute options, should i do it manually, or is there a technique which lets tells hibernate that now i want to set lazy=false??

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate