hi,
i'm using Hibernate3 and Spring MVC to build a web app. i have 2 tables that are related:
Code:
TABLE Customer
CustomerID uniqueidentifier PRIMARY KEY NOT NULL
CustomerName varchar(50) NOT NULL
Code:
TABLE Comment
CommentID int identity(1,1) PRIMARY KEY NOT NULL
CustomerID uniqueidentifier FOREIGN KEY REFERENCES Customer(CustomerID)
CommentDate datetime NOT NULL
CommentText varchar(1000) NOT NULL
my object classes - Customer.java and Comment.java each has only variables that are the columns in its table, default constructor, all getter/setters.
there can be more than one Comment per Customer.
should i relate them with a many-to-one? how would i do this? i've tried a few ways, all of which have been hugely unsuccessful.
thanks in advance for any help! - i need it