-->
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: How good are you in Hibernate? A mapping challenge
PostPosted: Fri Apr 28, 2006 4:16 pm 
Newbie

Joined: Mon Apr 24, 2006 2:01 pm
Posts: 13
Hibernate version: 3.1.3

Is it possible to create a one-to-may relation between two tables with the may side table having no primary keys ?

Here are the tables:


Participant:
--------------

Code:
Column name          Type                                    Nulls

owner_number         integer                                 no
participant_id       integer                                 no
list_id              integer                                 no
fname                char(50)                                no
lname                char(50)                                no
country_code         char(2)                                 no
phone_num            char(25)                                yes
phone_ext            char(6)                                 yes
phone_num2           char(25)                                yes
phone_ext2           char(6)                                 yes
fax_num              char(25)                                yes
call_order           integer                                 no
leader_flag          integer                                 no
intl_link_id         integer                                 no
commline_flag        smallint                                no
inactive_start_dt    date                                    yes
inactive_end_dt      date                                    yes
send_confirmation    smallint                                yes
email                char(65)                                yes




Address:
-----------

Code:

Column name          Type                                    Nulls

participant_id       integer                                 yes
owner_number         integer                                 yes
address_type         char(1)                                 yes
address_1            char(30)                                yes
address_2            char(30)                                yes
city                 char(20)                                yes
state                char(10)                                yes
country              char(25)                                yes
zip                  char(10)                                yes




Address table has a compund unique key for the following columns:

participant_id AND address_type



I need One-To-Many relation from Participant --> Address with cascade="all,delete-orphan"

THANKS IN ADVANCE


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.