-->
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.  [ 6 posts ] 
Author Message
 Post subject: Multiple POJOs to single table (existing db)
PostPosted: Tue Sep 12, 2006 6:49 am 
Newbie

Joined: Tue Sep 12, 2006 6:18 am
Posts: 4
Location: UK
Hibernate version: 3.1

Sorry, new to hibernate!!

I have created some POJOs that are mapped to a single table.
the keys are the same. They seem to function ok in isolation, but I am
worried that this is something I should not be doing!!

e.g. What happens if I delete an object, I do not want this to remove the
whole row in the database; as this would impact the other POJOs.

Is there a Pattern for this interaction? maybe I should stop the delete/inserts from being called on these POJOs.

My Use cases are simply to allow view/updates on these objects
I have created the objects to match the individual use cases.

Perhaps I should create a large POJO mapping to the whole table
and embed components??

thanks

_________________
Rob T.


Top
 Profile  
 
 Post subject: Re: Multiple POJOs to single table (existing db)
PostPosted: Tue Sep 12, 2006 9:39 am 
Newbie

Joined: Tue Sep 12, 2006 5:47 am
Posts: 4
Can you post the mapping file and also explain why multiple pojos are required for a single table?


Top
 Profile  
 
 Post subject: Re: Multiple POJOs to single table (existing db)
PostPosted: Tue Sep 12, 2006 9:44 am 
Newbie

Joined: Tue Sep 12, 2006 5:47 am
Posts: 4
Can you post the mapping file and also explain why multiple pojos are required for a single table?


Top
 Profile  
 
 Post subject: Re: Multiple POJOs to single table (existing db)
PostPosted: Tue Sep 12, 2006 9:48 am 
Newbie

Joined: Tue Sep 12, 2006 5:47 am
Posts: 4
Can you post the mapping file and also explain why multiple pojos are required for a single table?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 12, 2006 11:15 am 
Newbie

Joined: Tue Sep 12, 2006 6:18 am
Posts: 4
Location: UK
The 2 mappings just use different fields of the same table. This gives 2 seperate POJOs for different use cases.

e.g. View X Data and View Y Data where the keys are the same.

_________________
Rob T.


Top
 Profile  
 
 Post subject: Re: Multiple POJOs to single table (existing db)
PostPosted: Sat Oct 03, 2009 3:01 pm 
Newbie

Joined: Thu Oct 01, 2009 4:02 pm
Posts: 4
Hello,

Could you please post an example of how to write multiple pojo's to single table.

Thanks,
Raja Chandra Rangineni


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