This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all i am new to hibernate, and i am trying to join two tables called person and contact.I am getting the error in mapping. Please tell whats the problem.
Person Table SQL
create table person (Personid int Not null, street char (20) not null, contactid int not null, constraint primary_table Primary key (personid), constraint foreign_contact foreign key (contactid) references Contact (ID))
Contact Table SQL
create table CONTACT (ID int Not null, FIRSTNAME varchar(50), LASTNAME varchar(50), EMAIL varchar(50))
All properties in your mapping file must exist in your Java class, and all properties must have getter and setter methods so Hibernate can manipulate these values. So if you map a property "foo" which is of the type String, your class must have a getter called getFoo() that returns a String and a setter called setFoo(String) that takes a string as a parameter. Associations are the same, if foo is an association to a class called Foo you'll need the same getter and setter methods that deal with Foo objects.