-->
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: Partially populating Persistent Objects
PostPosted: Wed May 04, 2005 12:16 pm 
Newbie

Joined: Wed May 04, 2005 12:10 pm
Posts: 3
Hello,

I am working on a web based application and we are considering Hibernate as our O/R mapping tool. I am very new to hibernate, having only gone through a couple of tutorials.

Different pages in our application display different columns from the same tables. I was wondering if there is a way to obtain a partially populated persistent object with only the fields needed for each particular page.

I searched around the documentation and googled a bit and wasn't able to find the answer.

Thanks in advance for any help.
Eraser


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 12:55 pm 
Newbie

Joined: Wed May 04, 2005 12:10 pm
Posts: 3
After some more research, I found out that this can be done by creating constructors that take only the fields to be displayed/manipulated in each page. However, we would like to use middlegen to generate our mapping files and hbm2java to generate our Java source, therefore I don't think this approach would work for us.

If there is a way to have hbm2java generate the required constructors please let me know.

Thanks,
Eraser


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 3:42 pm 
Newbie

Joined: Wed May 04, 2005 12:10 pm
Posts: 3
Again apologies for replying to myself, but I think I found an acceptable solution and I would like to post it for the benefit of others.

Seems like using the Hibernate Synchronizer Eclipse Plugin (http://www.binamics.com/hibernatesynch/) will work for what we want to do since it generates base classes and a class extending the base class.

When regenerating, only the base class is overwritten. Since the custom constructors are placed in the child class, they are not lost when the code is regenerated.

Seems to me that this is a better solution than going with Middlegen and hbm2java to generate the mapping files and source.

Eraser


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.