Hibernate version:2.1.8
Hibernate dialect:net.sf.hibernate.dialect.Oracle9Dialect
The problem description:
I have 2 tables in my database: server, server_attribute;
I am trying to get all server objects with their attributes:
loadAll(Server.class);
SQL:
select this.SERVER_ID as SERVER_ID1_, this.URL as URL1_, this.CREATE_DT as CREATE_DT1_, this.MOD_DT as MOD_DT1_, attributes1_.SERVER_ID as SERVER_ID__, attributes1_.NAME as NAME__, attributes1_.SERVER_ID as SERVER_ID0_, attributes1_.NAME as NAME0_, attributes1_.VALUE as VALUE0_, attributes1_.CREATE_DT as CREATE_DT0_, attributes1_.MOD_DT as MOD_DT0_ from SERVER this left outer join SERVER_ATTRIBUTE attributes1_ on this.SERVER_ID=attributes1_.SERVER_ID where 1=1
The returned list size equals to server*server_attribute records count value (for example: 2 records in server table, 4 records in server_attribute
table; list size = 8).
Is it a default Hibernate functionality?
I expect the size to be equals to server table records count. Do i miss something here?
PS. i have the same problem with pagination:
setFirstResult();setMaxResults(); work fine only in case joins are not used.
Thanks in advance,
Jacob
|