Hibernate 2.1.6. This is going to be such a noob question and I apologize. I've been able to create sets/bags/maps in Hibernate with simple one-to-many type relationships. But what about a relationship as follows (I'll include MySQL create table SQL definitions to give you an idea):
Code:
create table tpp_contracts (
id char(32) primary key,
effectivedate datetime,
terminationdate datetime
);
create table tpp_contacts (
id char(32) primary key,
contractid char(32) references tpp_contracts(id),
contactid char(32) not null
);
create table contacts (
id char(32) primary key,
name varchar(128) default '',
title varchar(128) default '',
phonenumber varchar(64) default ''
);
The tpp_contacts table binds the tpp_contracts and contacts table.. thus allowing me to have contacts associated with a specific contract. Would this be considered a many-to-many association.. thus meaning I should read the docs on collections a little closer? Also.. since the tpp_contacts table simply defines the relationship of contacts to contracts, does it need the Hibernate "id" column?
Thanks
--------------------------------------------------
Hibernate version:
2.1.6
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
MySQL 4.1.1
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: