It will verify the object is there in the session or not..
Student student = new Student(); -- T
Student student = session.get(Student.class,"1"); -- P
If we are not looking the equal to right side code then how to know weather the student is there in the session or not...lets use contains...
Student student = (Student)session.get(Student.class,"1");
if(session.contains(student)){
System.out.println(".Contains");
}
Student student = new Student(); -- T
Student student = session.get(Student.class,"1"); -- P
If we are not looking the equal to right side code then how to know weather the student is there in the session or not...lets use contains...
Student student = (Student)session.get(Student.class,"1");
if(session.contains(student)){
System.out.println(".Contains");
}