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)