-->
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: property only on many-many
PostPosted: Wed Jun 29, 2005 4:26 am 
Beginner
Beginner

Joined: Mon Mar 07, 2005 12:02 pm
Posts: 39
Hi there,

I need some help creating and mapping a relationship in hibernate. I have a many-many relationship but its a bit tricky, there is a property that only exists on the relationship. The table structure looks like this:

CREATE TABLE `customer` (
`customer_id` int(4) NOT NULL default '0',
`customer_name` varchar(50) default NULL,
PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1


CREATE TABLE `order` (
`order_id` int(11) default NULL,
`order_number` varchar(50) default NULL,
PRIMARY KEY (`order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1

CREATE TABLE `customer_order` (
`customer_id` int(11) default NULL,
`order_id` int(11) default NULL,
`order_limit` int(11) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

I dont know how or where to map the order_limit column. Can anyone help me on this? Thanks alot


Top
 Profile  
 
 Post subject: light on the subject
PostPosted: Wed Jun 29, 2005 5:24 am 
Beginner
Beginner

Joined: Mon Mar 07, 2005 12:02 pm
Posts: 39
Let me explain this better. A customer has a order that has a limit.
So customer "Stephan" has order "V001" and its limit is 1.
customer "Stephan" has order "V002" and its limit is 2.
But customer "Gawie" also has order "V001" but its limit is 2.

Dunno if this sheds more light on the subject.


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.