-->
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.  [ 1 post ] 
Author Message
 Post subject: One-to-many for different types : is there a design pattern?
PostPosted: Wed May 12, 2010 6:05 am 
Newbie

Joined: Sun Sep 27, 2009 1:59 pm
Posts: 2
I have 3 types of Forms :
- CustomerForm.java
- SupplierForm.java
- ProductForm.java

These are all persisted towards the database

Now all these forms have a property
List<Attachments> attachments

Attachment :
- name
- url
- description

How do I need to map this is Hibernate since I want to map 3 tables towards 1 table of attachment. The table containing the attachment, I can add a column id, but I'm nut sure this id is unique, since ProductForm, SupplierForm, .. can generate the same id


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.