hibenrate weird question

火雲邪神 2015-07-25 05:10:58
Hi
I am using hibernate, i got two class "JMPDATA" and "PARAMETER", they are linked together. Then I execute :

session.createSQLQuery("SELECT a.* from JMPDATA").addEntity(JmpData.class);

I didn't join table parameter, but i still able to get the value of it, why?

iterator = query.list().iterator();
while (iterator.hasNext()) {
JmpData d = iterator.next();
for (Parameter p : d.parameters) {
System.out.println("\t" + p.name);
}
}

I am using H2 database, and i enable the trace log, i saw the h2 is receive this sql command from hibernate. I am sure it didn't left join the parameter table.

SELECT a.* from JMPDATA as a limit ?

thanks
from Peter (cmk128@hotmail.com)
...全文
74 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧