Hi All,
I am new to hibernate. When I went through some tutorial i got the concept lazy loading.
So what I have understood about lazyloading is, in hibernate by default lazy loading is true. That means when parent class is loaded,it will not load the child class. Am i right? If it is right
then I have the following scenario.
I have one student class and set of phone numbers.
so When I load the studentclass from the session it is already loading the set phone numbers too..I am getting details of child class as well.
Following is the code:
Code:
Student student = (Student)session.load(Student.class, new Long(12));
Set<Phone> phoneset=student.getStudentPhoneNumbers();
System.out.println("phoneset"+phoneset.iterator().next().getPhoneNumber());
System.out.println("studentid: "+student.getStudentId());
System.out.println("student name: "+student.getStudentName());
Please make me correct if I am wrong.
Thanks
Bhanu lakshmi.