-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Lazy one to one relashionship
PostPosted: Tue Jun 15, 2004 11:04 am 
Newbie

Joined: Fri Apr 16, 2004 11:48 am
Posts: 18
Is it possible to make a one to one relashionship load lazily?
In the below scenario by default I would like not to load the sdos field in obligation.


Code:

<hibernate-mapping>
    <class
        name="com.vo.cdo.Sdos"
        table="SDOS"
        proxy="com.vo.cdo.Sdos"
        dynamic-update="false"
        dynamic-insert="false"
        mutable="true"
    >

        <id
            name="referenceObligationId"
            column="referenceObligationId"
            type="java.lang.Long"
        >
            <generator class="foreign">
                <param name="property">referenceObligation</param>
            </generator>
        </id>

        <property
            name="text"
            type="java.lang.String"
            update="true"
            insert="true"
            access="property"
            column="sdosText"
        />

        <one-to-one
            name="referenceObligation"
            class="com.vo.cdo.ReferenceObligation"
            cascade="save-update"
            outer-join="auto"
            constrained="false"
        />

    </class>

</hibernate-mapping>



Code:

<hibernate-mapping>
    <class
        name="com.vo.cdo.ReferenceObligation"
        table="REFERENCE_OBLIGATION"
        dynamic-update="false"
        dynamic-insert="false"
    >

        <id
            name="id"
            column="id"
            type="java.lang.Long"
        >
            <generator class="native">
            </generator>
        </id>

        <property
            name="name"
            type="java.lang.String"
            update="true"
            insert="true"
            access="property"
            column="name"
        />

        <one-to-one
            name="sdos"
            class="com.vo.cdo.Sdos"
            cascade="all"
            outer-join="auto"
            constrained="false"
        />

    </class>

</hibernate-mapping>



Many thanks

Simone


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 15, 2004 11:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
http://www.hibernate.org/162.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 15, 2004 11:33 am 
Newbie

Joined: Fri Apr 16, 2004 11:48 am
Posts: 18
Many thanks!!!!

Simone


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.