-->
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.  [ 1 post ] 
Author Message
 Post subject: Not creating many-to-one proxies
PostPosted: Wed Sep 22, 2004 9:06 am 
Senior
Senior

Joined: Sun Jan 04, 2004 2:46 pm
Posts: 147
Hibernate version:
2.1.6

Is there any way of totally disabling lazy nested objects and just keeping them in the mapping file for doing the joins for you in the queries and explicitly fetching objects?

The reason is sometimes I have objects like this...

Code:
  <class name="ElementConnection" table="element_connection" lazy="true" >

    <id name="EctId" type="int" column="ect_id" unsaved-value="null" >
      <generator class="assigned" />
    </id>
    <version name="VersionId" column="ect_version_id" type="int" />

    <property name="BndId" column="bnd_id" type="int" not-null="true" />
    <property name="EctFromEltId" column="ect_from_elt_id" type="int" not-null="false" />
    <property name="EctToEltId" column="ect_to_elt_id" type="int" not-null="true" />

    <many-to-one name="FromElement" class="Element" column="ect_from_elt_id" update="false" insert="false" />
    <many-to-one name="ToElement" class="Element" column="ect_to_elt_id" update="false" insert="false" />
    <many-to-one name="Band" class="Band" column="bnd_id" update="false" insert="false" />

  </class>


But for various reasons I NEVER use the many-to-one nested objects in an object model way ( get/set ) but it is very nice to use them in queries for easy joining to other tables. And what I would like is when a ElementConnection object is retrieved for the lazy nested objects not to have a proxy created.

The reason is doing this:

Code:
session.find( "from ElementConnection" )


takes roughtly 50% longer ( 28 vs 43 seconds for 500k objects ) and consumes more memory ( although not much ) when the nested objects are present presumably because of the time required to create the proxy objects.

I don't think this is possible right now but I just thought I would check and see what anyone thought.


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

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.