-->
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: Plz help: unable to define the mapping :(
PostPosted: Thu Sep 29, 2005 10:31 am 
Newbie

Joined: Mon Sep 26, 2005 4:08 am
Posts: 15
Mapping documents:

hi everyone,

I am new to hibernate and using spring framework. I have the Hibernate documentation but unable to figure out. I have been trying to define a mapping for a database insert and select but unable to do that. Kindly help. Following is the scenario:

I have following tables:

1) Plan (PlanId, Plan_Name, Type)
2) Plan_Task (PlanId, TaskId) ->> PlanId comes from table (1), TaskId comes from table table (4).

3) Plan_Activity (PlanId, ActivityId) ->> PlanId comes from table (1), ActivityId comes from table table (5).

Now, the first table i.e. Plan is the mater table and tables (2) Plan_Task and (3) Plan_Activity are child tables. In addition there are 2 more tables:


4) Task (Task_Id, Task_Name)
5) Activity (Activity_Id, Activity_Name)


Now iwhen the plan form is being displayed a list comes up which displays a list of Task ids and activity ids and the type i.e. radio to indicate whether the user wants to store a task or activity.

Based on the type i.e. either activity or task, the data will go to an appropriate table i.e either Plan_Task or Plan_Activity. I am not been able to define a mapping for this.

Kindly Help.

Regards,
Gaurav


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 10:39 am 
Beginner
Beginner

Joined: Tue Sep 06, 2005 5:16 pm
Posts: 24
Location: USA
Use some tools(Like myeclipse) for automatic generation of mapping files.That way you can avoid lot of manual coding.


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.