| hi,
 i am just started learning hibernate. i am developing a project which is simple forum.
 
 So, i created my tables as
 create table Topic(topic_id number(8) primary key, Topic_Name varchar2(41));
 
 create table Questions(topic_id number(8),Question_id number(8), Questions varchar2(500), username varchar2(50), Q_Date Date)
 
 alter table Questions add constraint fk TopicId references Topic(topic_id);
 
 
 i got stuck up at one place i,e. which relationship mapping i have to use for inserting topic_id in both topic and questions table at a time.
 
 i am planning to use generator class as "increment".
 and based on topic_id i should generate question_id.. lets topic_id =1;topic_name="Java" question_id should start based on topic_id...
 
 
 if you feel i am doing some thing wrong please suggest me a good approach
 _________________
 If the blind lead the blind, both shall fall in a ditch
 
 
 |