-->
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.  [ 4 posts ] 
Author Message
 Post subject: Performance Hibernate
PostPosted: Thu Apr 22, 2004 10:44 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi,

I have the beans Company and MonthlyFee.
The relationship between these beans is 1-to-1.

How can I do to set to lazy=true in MonthlyFee.???

thanks

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 22, 2004 10:59 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: Thu Apr 22, 2004 1:39 pm 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi, my mapping file are:

Code:
<hibernate-mapping>
    <class name="Company" table="empresa">
      <id name="cnpj" column="cnpj">
         <generator class="assigned"/>
      </id>
      <property name="name" column="nome"/>
      <property name="corporateName" column="razao_social"/>
      <property name="address" column="logradouro"/>
      <property name="number" column="numero"/>
         <one-to-one name="monthlyFee" class="MonthlyFee"
            constrained="false" outer-join="true"/>         
    </class>
</hibernate-mapping>

<hibernate-mapping>
    <class name="MonthlyFee" table="mensalidade">
        <id name="cnpj" column="cnpj">
           <generator class="foreign">
              <param name="property">company</param>
           </generator>
         </id>
         <one-to-one name="company" class="Company"
           constrained="true" outer-join="false"/>      
        <property name="value" column="valor"/>
    </class>
</hibernate-mapping>


but when I use sessionCreateQuery("from Company");

it returns the ArrayList of Company, where within this bean has
the monthlyFee object. So within monthlyFee has company again
an so on.

I don

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 6:54 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
if it is possible the it is better to drop 1-to-1 and put data in to the same table . You can create Views for logic to "hide" phisical data storage details.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.