我有三个数据库表
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" />
但数据未插入数据库,
显示这些选择查询
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=? 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=?
问题出在哪里?
答案 0 :(得分:1)
问题是我没有冲洗会话。之后,每件事都没问题。 感谢。