-->
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.  [ 2 posts ] 
Author Message
 Post subject: Can we create a single java class for multiple tables & how?
PostPosted: Wed Sep 15, 2010 6:06 pm 
Newbie

Joined: Wed Sep 15, 2010 5:59 pm
Posts: 1
Hi,

I am new to hibernate. I have a requirement in which i have to create a single POJO class for the multiple tables having all relationship as many-to-one and one-to-many and how we will implement the mapping files as both hbm files will be associted with one class.I am not able to find any example on the net for this requirement.

Please help!

Thanks


Top
 Profile  
 
 Post subject: Re: Can we create a single java class for multiple tables & how?
PostPosted: Wed Sep 15, 2010 9:46 pm 
Regular
Regular

Joined: Sun Feb 14, 2010 3:29 pm
Posts: 58
Location: USA
Hibernate provide feature such as fine grain modeling, which allow you to have multiple POJO class per single table. The requirement you have is probably easily done by combine your tables in the database as a VIEW, then map a single POJO to it.

Since you are new to Hibernate, then you need to read Reference Manual, to see what it can provide you as a ORM so that you may take max advantage of it. Ref manual shows how to create the mapping file as you've asked.

_________________
Zemian Deng
------------
Need a Java Scheduler? Try
http://bitbucket.org/timemachine/scheduler


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