-->
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: How would you map this!
PostPosted: Thu May 13, 2004 9:35 am 
Beginner
Beginner

Joined: Wed May 12, 2004 2:52 pm
Posts: 36
The following is giving me a headache. Given the following tables:

Complaint
----------
complaintId (PK)
complaintValue

ReasonAssoc
----------
complaintId (PK)
reasonId (PK)
sequence
specificReasonId(FK)

Reason
----------
reasonId(PK)
reasonValue

SpecificReason
----------
specificReasonId(PK)
reasonId(FK)
specificReasonValue


A "complaint" can have many reasons associated with it. A reason may or may not have a "specificreason" associated with it. In addition, the reasons are indexed using the "sequence" column.

Any suggestions on how to map this?

Regards,

Joshua


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 13, 2004 9:42 am 
Beginner
Beginner

Joined: Wed May 12, 2004 2:52 pm
Posts: 36
The desired object model would be:

Complaint
----------
Long complaintId
String complaintValue
Set reasons

Reason
----------
Long reasonId
String reasonValue
int sequence
SpecificReason specificReason

SpecificReason
----------
Long specificReasonId
String specificReasonValue


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.