Hi
I am new to Hibernate. I just started coding.
Here is my scenario,
I have a table A and which has primary key (say k1), there is an associated table B where the primary key is a composite key( say k2)
k1 + timestamp +type creates the the primary key of table B ie, k2.
Now the tables are already in place and I am now incorporating Hibernate into this.
Here is my question.
For each row in table A there can be 0 or upto 6 rows in table B.
I have designed the HBM.xml and classes for table A to have an associatin set, of table B and the key is composite key and generator class is assigned.In this set declaration i mentioned lazy = true.
I have written Equals() and Hashcode() for classesfor table B.
(B 's objects object 1 = object 2 if the k1 and timestamp and type are equal)
My requirement is to load all rows from table A, with the corresponding set of rows from B where the number of rows inB is exactly 6.
so I have used the query to load all A's where setB.size =6;
Now I have doubt that this defeated the lazy loading cocept since I checked for the size of the set it loaded into the memory during the execution of the above mentioned query.
Can anyone please explain is that true / ho can I identify from the logs if all the rows are loaded on execution of the query itself. ?
Thanks
SKS[/b]
|