-->
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.  [ 7 posts ] 
Author Message
 Post subject: Load sparsely populated object?
PostPosted: Tue Apr 19, 2005 12:17 pm 
Beginner
Beginner

Joined: Wed Jul 21, 2004 6:50 pm
Posts: 27
Hi,

Can Hibernate just load part of an object? ie I want the object back, but only sparsely populated with a few of the fields?

cheers,

David


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 12:40 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
search wiki

you may use inheritance or lazy property (H3)

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 1:07 pm 
Beginner
Beginner

Joined: Wed Jul 21, 2004 6:50 pm
Posts: 27
Hi Anthony,

Thanks for your reply. Maybe you wouldn't mind explaining a little deeper...

Inheritance is out for us, I think, as the domain object just has lots of properties. Or am I missing something?

From what I've seen looking at lazy loading of properties, it seems somewhat discouraged? It seems to me that if the domain object is large, obtaining a sparsely populated one (say for a particular UI view) would be a common requirement.

Please let me know if I am not understanding this.

cheers,

David


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 1:45 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
are you asking about a big number of properties or big number of associations?

maybe this link will help you
http://www.hibernate.org/41.html

about lazy property, we aren't fan but that can help.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 2:07 pm 
Beginner
Beginner

Joined: Wed Jul 21, 2004 6:50 pm
Posts: 27
Hi Anthony,

Perhaps I should give more detail:

We have an object that has a Map of other objects, each of which can have a Map of other objects!

So, for our UI especially, there are times when we just want one of our main objects sparsely populated with only one of the first Maps, with only a few of its Maps.

We don't really want to perform a query and create the object ourselves - we'd like to specify what to load in the query and have Hibernate create the main object with the columns that are specified, which will relate to the other maps.

Is that any clearer?! What's the suggested way to handle this in Hibernate?

thanks very much,

David


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 2:57 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
next time, start explaining that ;)

map are collections, you can use lazy loading on it and eager fetch the collections you want using query.

All this is explained in the forum, in Hibernate in action...

please don't reply again until you've read
http://www.hibernate.org/ForumMailingli ... AskForHelp

i have no more time to "imagine" what your real problem is, sorry.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 3:14 pm 
Beginner
Beginner

Joined: Wed Jul 21, 2004 6:50 pm
Posts: 27
Sorry - I was actually asking for another part of the team, and didn't realise exactly what was happening til you prompted me!


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