-->
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.  [ 1 post ] 
Author Message
 Post subject: Data is not inserted in Many to Many mapping?
PostPosted: Sat Nov 19, 2011 2:07 pm 
Newbie

Joined: Tue Jul 26, 2011 1:30 am
Posts: 5
Hi All,

i have three DB tables

1. route(route_id)
2. stop(stop_id)
3. route_stop(route_id,stop_id)---mapping table

Route.hbm.xml

<set name="stops" table="route_stop" cascade="all">
<key column="route_id" />
<many-to-many column="stop_id" class="com.trackingsystem.model.Stop" />

</set>

Stop.hbm.xml

<set name="routes" table="route_stop" cascade="all">
<key column="stop_id" />
<many-to-many column="route_id" class="com.trackingsystem.model.Route" />

</set>


but data is not inserted in the DB,

it is showing these select queries

Hibernate:
/* get current state com.trackingsystem.model.Stop */ select
stop_.stop_id,
stop_.stop_name as stop2_106_,
stop_.lattitude as lattitude106_,
stop_.langitude as langitude106_
from
trackingsystem.stop stop_
where
stop_.stop_id=?

where is the problem?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.