-->
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.  [ 5 posts ] 
Author Message
 Post subject: can I make a map super lazy ?
PostPosted: Tue Feb 10, 2004 5:28 am 
JBoss jBPM Developer
JBoss jBPM Developer

Joined: Thu Aug 28, 2003 11:56 am
Posts: 30
Location: Belgium
Hi,

If I'm correct collections that are mapped with
Code:
lazy="true"
are not loaded until needed. When needed they are loaded completely.

I want to specify a hibernate mapping for my java.util.Map property so that I can fetch only the needed objects with
Code:
myMap.get("myKey")
without fetching the complete map from the database. Is this possible with the hibernate provided lazy map implementation ? I realize this is not so obvious because the other methods such as
Code:
myMap.size()
should keep on working properly.

Thanks for your attention.

Regards, Tom.
http://jbpm.org


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 10, 2004 6:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Use a proxy for the class.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 10, 2004 10:22 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Proxying class will load the objects ids contained in the map when accessiong it and then load object 1 by 1. This is not exactly what you want I guess

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 10, 2004 10:28 am 
JBoss jBPM Developer
JBoss jBPM Developer

Joined: Thu Aug 28, 2003 11:56 am
Posts: 30
Location: Belgium
No that is not what I want.

But I will try to write my own Map-implementation proxy. That should be doing the trick, right ?

Regards, Tom.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 10, 2004 10:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I don't think thats trivial, and certainly can't be done with just a custom map implementation (after all additions to the map have to be persistet, too, etc...)

There is a JIRA entry for this, you could vote on it. http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-24


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