hibernate study material

60
Hibernate 3.0 ! " ! # $%% $%% %%

Upload: jaffarshaik

Post on 08-Dec-2015

227 views

Category:

Documents


3 download

DESCRIPTION

Hibernate Study Material

TRANSCRIPT

Page 1: Hibernate Study Material

Hibernate 3.0

��������� ���� ����� ��� �� ���������������� �

������ �������������� � � ��

���������������

� ������� ���� ��

�������

� �� ������������������

���������������������������� �������

�����������������

!�����������������

���������������������

�������� ���������

� "����!����#���� ������

$�%� % ���$�%� %����������%� %����

Page 2: Hibernate Study Material

What is Persistence ?

�� ������� �&���' ����������� � ������������ �������������������"� !������������

� �� '����� �� ��� ���� ���� ������� �����

()������*��� �

���+��'���������� !��� ����� ������������������' ������������)

,)�-�

.����� �������� '�� ���/��������� �����������)

0)�$�&��% ���������������������������

$$��������������+�����������������������������������"�)

Page 3: Hibernate Study Material

Mapping

����������������������������������� �&��+�������������� �� �� �'����� '����������)

import java.io.Serializable;import java.util.Set;public class Employee implements Serializable {

private String name;….private Set addresses;public Integer getAge() {

return age;}public void setAge(Integer age) {….public Set getAddresses() {

return addresses;}public void setAddresses(Set addresses) {

this.addresses = addresses;}

package com.test;

public class Address implements Serializable{

private Integer id;….private Employee empObj;public Integer getId() {

return id;}…..public void setId(Integer id) {

this.id = id;}public void setEmpObj(Employee empObj) {

this.empObj = empObj;}

}

Page 4: Hibernate Study Material

Common Mapping Techniques

������������

���������"������������ ��' ���������������� ���������������������

���������� �&������ ���������������)

���������

������������������������ �������!������� �&����� ������

�������� �����������������������"������������������������ !� '���� �&�����'����

������������������������������"��������� �&������� �&����� ������������)

!���� ��"������

.� ���������������!������ �&������������' ������������������������

��� ��������� ������)��'������������� ������������ �&�� �������!���������������

����������������� �����������������������)��

Page 5: Hibernate Study Material

Common Mapping Techniques

#�������������������

!�������������������������

����%������������������������

�������� ��������������������������

������ ������

$��1 � �1 $�

$��1 � �1 ����

�����1 � �1 ����

Page 6: Hibernate Study Material

Chapter 2- Introduction to Hibernate

#���������$

������������&���%����������!���������� �� �����$2#���������� ��)

.��������

() �������� ���/��3 �� ������ �����)

,) ��������/���������������' !��

0) ������������������������ ���� ���/�������

4) ���� ���� �� ���� ������������������ ����� ��)�5��)

Page 7: Hibernate Study Material

Chapter 2- Introduction to Hibernate

#���������%�����������

Application Classes

Hibernate

JDBC JNDI JTA

Database Server

Page 8: Hibernate Study Material

Chapter 2- Introduction to Hibernate

#���������� �&������� �

Application Classes

Hibernate

JDBC JNDI JTA

Database Server

Configuration

Page 9: Hibernate Study Material

Chapter 2- Introduction to Hibernate

#���������� �&������� �

���� �'������ �������+�� ���� �������! �"��� �� ������������������ ����� ������

��������%������������)

���'����� �� ���������������� ���� �� �� �� �'������ � '������� ������

������)������'������������)� ���� ����������)�'�)/��'��)

Page 10: Hibernate Study Material

Chapter 2- Introduction to Hibernate

67/������ �89():9��� ����89��'%;97<

6=>$��?�5�������%� �'������ ���@A ��

B%22������2�������� �'������ ��>�>�0):225CB

B����D22������)� ��' �)��2������%� �'������ �%0):)���B<

6������%� �'������ �<

6���� �%'��� �<

6=%% >�������� ����� ����������%%<

6� �������8B� ����� �)���E�����B<� �)�����)&���)>��62� ���<

6� �������8B� ����� �)��B<&���D�����D22� ���� ��2������62� ���<

6� �������8B� ����� �)�����B< �62� ���<

6� �������8B� ����� �)����! �B<�����62� ���<

6=%% F>A��� ����� ��� ��G�����������%��H�%%<

6� �������8B� ����� �)� �E��*B<(62� ���<

6=%% �3 ��������%%<

6� �������8B������B< �)������)������)��3 >�����62� ���<

62������%� �'������ �<

Page 11: Hibernate Study Material

Chapter 2- Introduction to Hibernate

6=%% 5�����������9� ��� ���������� ��� ��/�����������%%<

6� �������8B����E���� �E� ��/�E�����B<����62� ���<

6=%% >����������� ��%����������%%<

6� �������8B����)� ���E�����B< �)������)����)C ����� ���62� ���<

6=%% 5�� �����/������3 �� ���� �� %%<

6� �������8B�� !E���B<��62� ���<

6=%% > ������%��������������������� ���������%%<

6� �������8B���,���)��� B<���62� ���<

6��������� ��8B� �2���25��� �)���)/��B2<

6��������� ��8B� �2���2.����)���)/��B2<

62���� �%'��� �<

Page 12: Hibernate Study Material

Chapter 2- Introduction to Hibernate

C !�� ��������������*�������������

���� �I��� ����� �8�!�� �'������ �GH)� �'���GH)��������� �I��� �GH

$

���� �I��� ����� ��8�!�� �'������ �GH

)� �'���GJ2� �2���)�'�)/��KH)��������� �I��� �GHL

Page 13: Hibernate Study Material

Chapter 2- Introduction to Hibernate

���� ����'���

() ������'���������������������� ���� ��' ���������#@>������������ ���� ��)

/D����� ����������� ������3��

,)����'���������������������� ����'��������� ��� �� �'����������

/D�� �'������ �������

0)��������"����'������������ !������������� ��� ������ ������ ����������������������������

/D������� ����'��������������������

4) ���'������������ !�/���� �� '�������+� � !'�����������'����� ������

/L�@������� �� ���@���� ���������'�M��� )

Page 14: Hibernate Study Material

Chapter 2- Introduction to Hibernate

������� �����'��

() ���������'�������������������������� ���,) ����!�����������/������� ������������ �)0) C��� ��������������� ��� ����������)4) C ��������'���� �������������� ���������� ���� ���������������)N) �������� ����� '���������� �� ����������� �� ����� ��� '�� ���� �&��������������� '�! ")

O) ������������� ���� ������������� ����������������� � ���� �������� �)

Page 15: Hibernate Study Material

Chapter 2- Introduction to Hibernate

������� �I��� ����'��

() ���� ����� �������' �������� �I��� �,) ��������� �������������� ����������������� �������)0) ���������� ��' ����!� ����������� �)4) �'�� ����������� ��������������������������������������� � �+������ ����������' ������������)

N) ������� �I��� ��������������3 �������������� �������������������������������������������)�������� �� ��������������������������������� ������� '�! "��������������������'��������� '�! "�1 �����'������������ ����� ���������������'�������������� ��%������������������)

Page 16: Hibernate Study Material

Chapter 2- Introduction to Hibernate

���� �'������ �����'��

���� �'������ �� �&����������� �� �'����������)��

������������ ��������� �'������ ����������� �����'������ ���� �� '���������� �����������������%����'���� ������������������������ �I��� �)

����������� �����'��

����������� �����'��������� ��� ����.��������� ����F>A���������� �� �F�.�����"���������� �������!����''���"����� '�/���� ����� ����������� ������)

Page 17: Hibernate Study Material

Chapter 2- Introduction to Hibernate

3����������������'���

���3������'������ !��� ��� ��' ������������������������������� �� ��� !�����������/����)

3����!���������3 � ��������������3 �������� '�� ���������.�3������������������� �������������������������������� '���������������������������'�������� �/����������)

������������'����������������������� !��� ��� ���������/���� �&��% ���������������)

.�3�������������������!������������+�������� ������������� ��������������)

Page 18: Hibernate Study Material

Chapter 2- Introduction to Hibernate

����

.������������ �&����������&��������� ������������ ��������������������������������� ��������������������� '�������������������' ������&�"������)�G��*)�������*���H

����������� �����%�'�������� ������)��� ����@���� ����2� �� ���@���� ���'���)

Page 19: Hibernate Study Material

Chapter 3- Creating Persistent Classes

���������������F����������)

�������!���� �����������������������'������������������ ���������' �� ���������������� �������������'����)�����������!������� ����'����)

.�����������������!��������������� ����������������� �����������2������� ��)

���������������� �� ����� �������)�������������������������' ��&������ ����������������'�������������������� ����� �������� �� �� ������������� ������������������������������� ����� '�� �� ���� �.������������ ����� ����������>.������������ �����������'������ ������ ���'�����'����������������� �������������������������� ���������� ��

Page 20: Hibernate Study Material

Chapter 3- Creating Persistent Classes

����������A�����F���������

�������������A "P��������� ��������� ������L��������������������� �����L������'� ���� ��L22M������������������� ���' ������ ��'����QQQR

Page 21: Hibernate Study Material

Chapter 3- Creating Persistent Classes6=>$��?�5�������%���������@A ��

B%22������2���������������>�>�0):225CB

B����D22������)� ��' �)��2������%�������%0):)���B<

6������%�������<

6���������8B� �)���)A "B�����8JA$$��B<

6������8B��B����8J���K ������%����8J:K<

6���� ������8J��� B2<

62��<

6� �������8J����B�2<

6� �������8B���� B�2<

6� �������8J����K � �%����8J��K2<

6� �������8J����K ���8J����K � ����8J���� ���K2<

6� �������8J� ������K2<

6� �������8J� ��K<

6� ��������8J� ��K ���%���8JC@�5#��G(,�,HK2<

62� ���<�������62�����<62������%�������<

Page 22: Hibernate Study Material

Chapter 3- Creating Persistent Classes

() ������%�����1 ��'�� !������������� ������������� �&��)

��������'���������� '� ��A "������������������������ ����������� '������' ����!� �&�����������������' ���� �&���������' ���� ��)� ������� ��������������� '���������'������� ��������� �������� ����'���������������%�������������� �������!������������� ������������� �&��)���'�����'���������� '���������'���������� ����������� �����+��������� ������ ����������'����������������������%������������)

6���� <�����

���������������� ��������!� !�� �������' ���&���� �&������������������������������������'����������� �����!�������������������� ��� ��������������'�������������� �&��)

Page 23: Hibernate Study Material

Chapter 3- Creating Persistent Classes() A����%������� �

�������1 ����' ���������� �������������������������������>������������������� �����/���������G�'�� ���������������������� �������������� ����+����'������� ����������� ������������ �������� ��)

��������1 �'����������������������� �������� ������!�������G��,���������%��������������� ����������� ������������ �������� ��H

������1 �'�������������������� �����G��,��� ����� ������.������� ����������� ������������ �������� ��H

Page 24: Hibernate Study Material

Chapter 3- Creating Persistent Classes() A����%������� �

��� �1�������������>��' ������������������ ������������)� ��������� ����������������� ����� ����������� �����������������)

����'�������������������%�����%"��������������� ���������/�%����)��? ������ ������ �� !�����������)

���������������%�����%"���/�%��������

�������� �������%�����%"�������G(::H

I ����� �����

6���� ������8J��� K<

6���� ���8J����K<��� 62����<

6���� ���8J� ����K<�/�62����<

6���� ���8J��/�� K<N::62����<

62���� <

Page 25: Hibernate Study Material

Chapter 3- Creating Persistent Classes

() A����%������� �

�����

�������� ���������������������� ���� �)G��,�� ���� �������H

@���)�/

������������������������ ��������������' �� !���������� ��������������������������������� '���������FS������������������������ ��������)

@���)�����

������� ������"�@���)�/�������������������������(O���������� ��)

C�����

���"����������������� ���� ���������� ������������)

Page 26: Hibernate Study Material

Chapter 3- Creating Persistent Classes� ������������� ��������������������������������������� �

�������������������@���P

�������������'��������� �I��� ����� �I��� �L

�������P

���P

22������������ �I��� �' ��������)�'�)/��

���� �I��� �8��!�� �'������ �GH)� �'���GH)��������� �I��� �GHL

R�������G�� !��� /H�P

22���"����� ��� �����/���� ������������������!��� !�

�����))������GB����������� �I��� ����� ��'����)B�T�/HL

�� !��!�5/���� �����������*5 G/HL

R

R

Q))

Page 27: Hibernate Study Material

Chapter 3- Creating Persistent Classes� ������������� ��������������������������������������� �

��������������'��������� ������� �8�!����� ���GHL

������������������ ���������� �GH��� !��������5/���� �

P

���� ���8G���� �H���� �)��GHL

�'G�88����HP

�8���� �I��� �) ������ �GHL

���� �)��G�HL

R

�����L

R

��������������� ����� ����� �GH�� !� ������5/���� �

P

���� ���8G���� �H���� �)��GHL

���� �)��G����HL

�'G�=8����H

P

�)�� �GHL

R

R

R

Page 28: Hibernate Study Material

Chapter 3- Creating Persistent Classes

�����������������P

2UU

U�V���� ���

U2

��������������� �������G�����WX����H�P

22��$>$�.�� %��������� ������

���� ������ � 8�������@���)�������� �GHL

A "�� "8�!�A "GHL

� ")������GQ)

Q

���� �)���G� "HL

���� �)'����GHL

���� �)�� �GHL

R

Page 29: Hibernate Study Material

Chapter 3- Creating Persistent Classes

����������������!����A�����>���

�����))�P

������A� ������L

Q

R

�������

6� ���Q

6� ��������8J����K ���%���8J�� �K2<

Page 30: Hibernate Study Material

Chapter 3- Creating Persistent Classes

���������������*��� �����

���� ���������� ����������&���� �&����������'�������������������������������!�������� ���������������)��.����������������������"����������� '���������*��� �����'������������� �&����������)

������� ���P

����������������L

Q

R

�������

6� �������8J�����K ���8J�����*���K<

6� ��������8J����K ���%���8J�� �K2<

62� ���<

Page 31: Hibernate Study Material

Chapter 3- Creating Persistent Classes

@���

� ����� �8G� ���H���� �)� ��G� ���)������(H

��� �8� �)�������GH)���S���GHL

Page 32: Hibernate Study Material

Chapter 3- Creating Persistent Classes

��������!����>��2�������.�������

������.�� ���P

))

������>�����������L

R

�������

6� ���Q

6� ��������8J����K ���%���8J>��K2<

Q

@���

.�� �����8G.�� ���H���� �)� ��G.�� ���)������(HL

�)���������GHL

Page 33: Hibernate Study Material

Chapter 3- Creating Persistent Classes

����������#��%$���������

6���������8J�KQ)��������8J'���K<

Q)

62�����<

@��������� �)���G�H�1 ��� !�� ��� �������������������"� !����� �&���� ����+����������)

Page 34: Hibernate Study Material

Chapter 3- Creating Persistent Classes

���������������������S�� ����2���������

������ �� ������������������������������' ���������'�������! ����������������' ��������������������� �� ������������������)������������������������� ��������!������ �&����������������������������� ��� �+�������������'��' ���������)

������S� ���

P

��� ��L

���������L

��� ��� �L

Q

R

Page 35: Hibernate Study Material

Chapter 3- Creating Persistent Classes

�������

Q

6��� �����8J��� �K � ����8J��� �+ ���8Y����K

������%����8J���'���K2<

))

���

����������� ��� P

������ � ���������� %�������������"����� � ������� �/�HL

@���

))

S� ��� � �8�!�S� ���GHL

� �)��C��GJ��KHL���� �)���G� �HL���� �)'����GHL

��� ��G� �)��S�� �GHHL

Page 36: Hibernate Study Material

Chapter 3- Creating Persistent Classes

��������

��� ��&���)���)UL

������� ����P

Q

�����������������L

R

�������

6������������8J��������K � ����8J�����K ������%����8J���'���K2<

���

���������� ���G�))���������������QHL

Page 37: Hibernate Study Material

Chapter 3- Creating Persistent Classes

�����������������!����F����������)

����'���'������#����������������6������%�����������"��8B� �)���B<

6���������8B�>B�����8B�>B����������� %����8B��B<

6������8B��B�� ����8B�>B�������%����8B:B<

6���� ������8B��� B2<

62��<

6��������� � ����8B��E���B����8B�����B2<

6� �������8B����B�� ����8B��� 5B2<

)))

6������������8B������5���� ��>B����������� %����8B������5���� ��>B<

6� �������8B�!'����B����8B�����B2<

62��������<

6������������8B������� ����>B����������� %����8B������� ����>B<

6� �������8B� ����B����8B�����B2<

62��������<

62�����<

62������%�������<

Page 38: Hibernate Study Material

Chapter 3- Creating Persistent Classes

�����������������!����F����������)

���'���������� ����������������������6��������� <�����)��

����������������������������������>� �&������+�������� ���������������>�!���������� ��������������' ������>�������������� ������������� �����)

���������������������������������������5���� ��> �&���������������� ���������>�������������>� �&��)��.����� ���������������������' �����������5���� ��>)��

InternationalCDindianullRock4555

SpecialEditionCDnullblastRock344

CdnullnullRock4343

Cd_typecountrynewfeaturesTitleid

Page 39: Hibernate Study Material

Chapter 3- Creating Persistent Classes

@���

�>���8Q

������5���� ��> ���8Q

Q

���� �)���G��HL

���� �)���G���HL

���� �)���G���HL

���� �)'����GHL

���� �)�� �GHL

Page 40: Hibernate Study Material

Chapter 3- Creating Persistent Classes

����'���'(�������������������������6=>$��?�5�������%���������@A ��

B%22������2���������������>�>�0):225CBB����D22������)� ��' �)��2������%�������%0):)���B<

6������%�����������"��8B� �)���B<

6���������8B�>B�����8B�>B����������� %����8B��B<6������8B��B�� ����8B�>B�������%����8B:B<6���� ������8B��� B2<

62��<6� �������8B����B�� ����8B��� 5B2<)))6& ���%������������8B������5���� ��>B�����8B���B<6"��� ����8B��B2<6� �������8B�!'����B����8B�����B2<62��������<6& ���%������������8B������� ����>B�����8B���B<6"��� ����8B��B2<6� �������8B� ����B����8B�����B2<62��������<62�����<

62������%�������<

Page 41: Hibernate Study Material

Chapter 3- Creating Persistent Classes

���������� ��������������������

C��� ��������������!������������ ��������)

C��� �����6�����))<������' ���������2����)

Page 42: Hibernate Study Material

Chapter 3- Creating Persistent Classes

) ������*����� �����+ ������

6�����))

6� �������8J'������K ' ����8J� ����G'�������+ Y��������HK2<

62�����<

Page 43: Hibernate Study Material

Chapter 3- Working with Collections

) ������*����� ������ ��

����' #������,�( ������� ' ������,�

(���' #���(��,�( ����(�� ' ���(��,�-����' %����-���,�

���������� &������������� �� ����������������������.

.�� ����� ��

5/D import java.io.Serializable;import java.util.Set;public class Employee {

private String name;….private List addresses;public Integer getAge() {

return age;}public void setAge(Integer age) {….public List getAddresses() {

return addresses;}public void setAddresses(List addresses) {

this.addresses = addresses;}

Page 44: Hibernate Study Material

Chapter 3- Working with Collections

����/�0�������

�&������ ������ ����������� ���������/,�-���,������,� ��� ��,�� ��������1����� ������������������� �� �����������/�� ���� �� &���������������������� ������ �.

0/2�3����/�� ����45� ����6 ����45����6 ������45������678

�������� &����,�� �9���� ���� �� ���������� ����������������������/�� �����1���������������.

3����/'����'� '������ ����45� ����6 �����45�����678

�&�� �������� �������� �� ���������/�& ��� ���� ������ �,�� �����������&���������������3� �� ����'����/8

3� �� ����'����/������45�����68

3���'�� ����������45����6 ����45����6 � ����45� ����678

37� �� ����'����/8

���"�%� ���������� �����'��������������������� '����� �� �������/)

Page 45: Hibernate Study Material

Chapter 3- Working with Collections5�����5�����

.������������ '���� ����� ������������������� ��������/������ ���� ����� �)��

�'�� ��� ����� �� ����� ��������������� ��������6����<

6������ ����8J� ����K ���8J���K2<

���� ��������������������������������������)

�'�� ��� ����� ��� ������� �&������ ��������6����%� %����<������� �����'���� �� �&���)

6����%� %������ ����8J� ����K �����8J�����K ��%& ��8J���Z'����Z��� K2<

? ������������������ �� ����������&����� ����� ����������

6� �� ���%����������8J�����K<

6� �������8JK2<

62� �� ���%����<

Page 46: Hibernate Study Material

Chapter 3- Working with Collections

A�%����� ����.�� ����� ��

�*����������*��� �

���������������� '��' �����!���� ������������ ����� '����������� ����� �)���'����� ����� �����������)

6���������8JM ��K � /�8JM ��K)

6�����*�8J��+<62��<

62�����<

���������������������������������������������������)��

Page 47: Hibernate Study Material

Chapter 3- Working with Collections

�������������2�� ������

���������� �� ���

P

��������� ��L����� ���������L

����������� ����L

R

�������

6���������8J���� �� ���K ����8J���� �� ���K<

6������8J��K<

6���� ������8J�����K2<

62��<

6�������8J� ����K<

6"��� ����8J���E��+2<

6���/�� ����8J� ���E���K ���8J�����K2<

6������ ����8J� ���E����K ���8J�����K2<

62���<

Page 48: Hibernate Study Material

Chapter 3- Working with Collections�3

������������� �� ���GQ

���������� �����G

��������� ���E��� �/���� ���E���� �/�HL

������������������������ �� ��� �&��������� ��������� '���� �&���������� !�����3 � ���� ����������������������"��' �������� �� �������)��������� ���������������������"����������������� ���!�������"�2������ '����� ������������ ����� ���������)

Page 49: Hibernate Study Material

Chapter 3- Working with Collections@���

���� �� �����8�!����� �� ���GHL

��)��C��GJ�����KHL

��������8�!��������GHL

�)���GJ� � K�K���KHL

�)���GJ��'K�K���KHL

�)��� ����G�HL

Q))

�����,8��,)��� ����GHL

��� ��G�,)��GJ� � KHHL

Page 50: Hibernate Study Material

Chapter 3- Working with Collections

�����������$�&�������D6����%� %����<�����

Page 51: Hibernate Study Material

Chapter 4- Using Persistent Objects

(�1������� ��������� ���������� �

() ���� �)���G� "H

- �������������� ����������

������� �&���� ��G����� ������������*��� ��� �"� � � �H

������� �&���� ��G����� ������������*��� ��H

�������� ���� ��G����� ������������*��� ��H

A "�� "8GA "H���� �)� ��G@�)������:H

$����� �)��G��)������:HL�%% !����� ���� !����/���� ���'�� ��� ��� /���)

+�������������

>��������/���� �� '����'����������������3 ����������� /����)���������/�����'�������� ����������!������ ����GH���� ������������� !���������������'���GH���������GH���� ��)

Page 52: Hibernate Study Material

Chapter 4- Using Persistent Objects

��������� ������

���� �)���G� "H

��&���������������

���� �)'��G� "HL

:���������������

���$@����G� "H�1 �������� ���������!�������� ����� �&����� ���������������' ����'�������� �������)

@����G� "H�1 ��������������!������� �&������������� ������������������������������ ������3 ���������� ���"����������������������������)

@����G� "�:H�%

I����GH�1 ���'�������� ������������!������������������������ ���� �&�����'�� ���������������������)

Page 53: Hibernate Study Material

Chapter 4- Using Persistent Objects

+�������������

������� ����'���G��������H

������� ����'���G���������$�&�� �������������H

������� ����'���G����������$�&��WX�����������WX�����H

����� "�8���� �)'���GJ' � A "KHL

���� �)'���GJ' � @��!��������JT������TKKHL

���� �)'���GJ' � @��!��������87K�������������)�����H

���� �)'���GJ' � @��!��������87�$����G�����HK��!

$�&��WXP�����������R��!���WXP������)��#�CM�������)��#�CMR

Page 54: Hibernate Study Material

Chapter 4- Using Persistent Objects

+�������-���������������

������� ��������G��������H

������� ��������G���������$�&�� �������������H

������� ��������G����������$�&��WX�����������WX�����H

���� ��8���� �)����GJ' � @���� �������KHL

����G��)���C/�GHH

P

@����8G@�H��)�/�GHL

Q))

R

Page 55: Hibernate Study Material

Chapter 4- Using Persistent Objects

+���������� ������ ��.

A "�� "8���� �)� ��GA ")������:H

� ����� ������ �8���� �)'���G� ")��.��� �GH�K!� ����)���� ��� ��"�Y�[+ KHL

� ����� ������ �8���� �)'���G� ")��.��� �GH�K���� ����)���� ��� !������)����

��"�Y�[+ KH

��!+�������� ����������� ���� ������� '�������� �&��)

Page 56: Hibernate Study Material

Chapter 4- Using Persistent Objects

(������;�������

� �'��!������������ �&��� ������ '� �&������������������� ������ ��� �����

�������������������� �� ���� '���������)

��������8���� �)'���GJ���� � ")������*G� ")���� �H�' ��� "HL

' G��� �8:L�6����)��*GHL�TTH

P

$�&���WX� !8����)��G�HL

���������8G�����H !W:XL

Q)

R

��������� ����������������� �&�����

��������8���� �)'���GJ���� � "��� ")������*G� ")���� �H�' ��� "HL

))

A "�� "8GA "H !W:XL

Page 57: Hibernate Study Material

Chapter 4- Using Persistent Objects

;�����������"�����;������

@��������3��� �&��

.�� !��� �� �� �� ����������

3������8���� �)���3��GJ' � A "�� "!��� ")��� <(::KH

�'G���)�����#����GHH

P

Q))

R

Page 58: Hibernate Study Material

Chapter 4- Using Persistent Objects

"�����;������

3<���������45&���%--68

3=>��% %>�&� ��? ��� �@@8

37<����8

�������������������������������&���

;�����<����4����� �.���"����;����A5&���%--6BC

;����.�����/�������ADEBC

;����.���+����������AEBC

-����� ��4<����.����AB

..

Page 59: Hibernate Study Material

Chapter 4- Using Persistent Objects

"�����;�������*����"���������������

3<���������45&���%--68

3=>��% %>�&� ��? ��� �*������ �.����� 8��21�����@@8

37<����8

�������������������������������&���

;�����<����4����� �.���"����;����A5&���%--6BC

;����.�����/�������ADEBC

;����.���+����������AEBC

;����.������A51����6,FFB

-����� ��4<����.����AB

..

Page 60: Hibernate Study Material

Chapter 4- Using Persistent Objects

���������;����

�����������������4����� �.��������������A? �.�����B

��������.���A0/������ �.�<A5����6,6����6BC

��������.���� �/�������AEBC

-����� �4��������.����ABC