01 03 2023 Hibernate Class Notes
01 03 2023 Hibernate Class Notes
============================
Language(java)
Technology(JDBC)
Framework(ORM tool)
HibernateArchitecture
==================
refer:******.png
Hibernate Configuration File will provide all the configuration details like driver
class name, driver URL,
Database User name , Database password,.... which we required to establish
connection with database and
to setup JDBC environment.
Hibernate Mapping file will provide all the mapping details like Bean Class name
and Database table name, ID property and
Primary key column , Normal Properties and Normal Columns,....
In Hibernate applications, mapping file is able to provide the mapping details like
Basic OR mapping, Component mapping,
inheritance mapping, Collections mapping, Associations mapping,
To prepare mapping file in Hibernate applications we have to provide mapping file
name with the following format.
"POJO_Class_Name.hbm.xml".
The above format is not mandatory, we can use any name but we must provide that
intimation to the hibernate software.
In Hibernate applications, we can provide any no of POJO classes, w.r.t each and
every POJO class we can define a separate
mapping file.
refer: *****.hbm.xml
Session
It is a Light Weigth Object(con++)
It is a mutable Object.
Not ThreadSafe by default.
Created by using openSession() which is designed based on 'factory'
design pattern.
Short lived Object of the application.
It maintains Level-L1 cache.
4. Create Transaction Object:
Transaction is a unit of work performed by Front End applications on Back end
systems.
To represent Transactions, Hibernate has provided a predefined interface in the
form of "org.hibernate.Transaction".