Survey类里的设置:
@ManyToMany
@JoinTable(name="sur_que",
joinColumns={@JoinColumn(name="s_id")},
inverseJoinColumns={@JoinColumn(name="q_id")}
)
我想要查询s_id=1的q_id以及Question的所有属性,用SQL语句实现:select * from question where q_id in(select q_id from sur_que sq where sq.s_id=1 ),或者用标的连接也行,关键是HQL语句是面向对象的,怎么处理?
hibernate?
hql
------解决方案--------------------
新建一个类sur_que,然后在这类内
我想你懂的
private Questions q;
private Survey s;