由买买提看人间百态

topics

全部话题 - 话题: queryb
(共0页)
c******n
发帖数: 4965
1
来自主题: Java版 - hibernate question
A ---- B is many to many relation
so in DB there is a A_B mapping table.
now I want to do hql : " from A a where a.setsOfB = :queryB " and do
session.createQuery("from A a where a.setsOfB = :queryB " ).setEntity(
oneInstanceOfB).list()
Hibernate does a 3-table JOIN,
select * from A a join A_B ab on a.B_ID = ab.B_ID join B b on b.B_ID = ab.B_
ID where b.B_ID = [ oneInstanceOfB.getId() ]
but instead, supposedly it should be able to just JOIN A and A_B table,
I set lazy=true everywhere, and from... 阅读全帖
M**********n
发帖数: 4964
2
很少用Access,实在对Access不熟悉。请大牛们指点指点怎么做,给个方向/idea。
比如我现在有一个十万record的table,我想根据三个fieldname(假设fieldnameA,
fieldnameB,fieldnameC) filter table,然后generate report。
我现在根据这三个fieldname弄了三个group by query,每个query只有这个fieldname
,没其他field了。比如queryA有100行,queryB有300行,queryC有500行。然后在form
上弄了三个combo box,每个combo box的dropdown list来自各自对应的query,ComboA
有100 dropdown item,ComboB有300 dropdown item,ComboC有500 dropdown item.
其实这个十万record的table是dynamic的,每过一段时间就要import new data append
到这个table里面。所以那三个query的行数(dropdown item)有可能是... 阅读全帖
(共0页)