hibernate(h8) in action
TRANSCRIPT
![Page 1: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/1.jpg)
HIBERNATE(H8) IN ACTIONPriyank Kapadia
![Page 2: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/2.jpg)
WHAT ARE WE TALKING ABOUT
Persistence Hibernate ORM(Object Relation Mapping)
Everything is objects and not a ResultSet or a RecordSet .
![Page 3: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/3.jpg)
PERSISTENCE UNVEILED
The storage of an object on a disk or other permanent storage device as opposed to transient data
Persisting data = Durable Integrity maintained
Persistence generally implies use of a database Even file system can be used, needs to handled well
![Page 4: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/4.jpg)
PERSISTENCE CLASS
![Page 5: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/5.jpg)
O/R MAPPING
Programming technique for converting data between incompatible type systems in databases and OOP languages.
“Database of Objects” which can be used by the developers using a programming language
Commercial packages as well Open Source Packages available that perform OR (Object Relation) mapping
![Page 6: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/6.jpg)
ORM VISUALIZED
![Page 7: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/7.jpg)
JAVA OBJECTS VS. DATABASE
int _id;String _desciption;String getDescription()int getId()void setDescription(String)void setId(int)
SQL Tableid primary key,Description varchar2(50)
Magic Happens Here(O/R Mapping – i.e. Hibernate)
Java Object
![Page 8: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/8.jpg)
HIBERNATE ??
Hibernate is an object-relational mapping (ORM) solution for the Java language.
It is free, open source software that is distributed under the GNU Lesser General Public License.
It provides an easy to use framework for mapping an object-oriented domain model to a relational database
Maintained by Jboss Inc.
![Page 9: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/9.jpg)
HIBERNATE SIMPLIFIED
• H8 is between the DB & code
•Maps Persistent objects to tables
![Page 10: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/10.jpg)
SO WHAT? FEATURES?
Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types),
Provides data query and retrieval facilities and can significantly reduce development time otherwise spent with manual data handling in SQL and JDBC.
Hibernate generates the SQL calls and relieves the developer from manual result set handling and object conversion, keeping the application portable to all SQL databases.
![Page 11: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/11.jpg)
ADVANTAGES
Industry recognizes these as why we should use hibernate Support for Query Language Database Dependent Code Maintenance Cost Optimize Performance Automatic Versioning and Time Stamping Open-Source, Zero-Cost Product License Scalable
![Page 12: Hibernate(H8) In Action](https://reader036.vdocuments.us/reader036/viewer/2022071815/55a9a6691a28ab9f518b4882/html5/thumbnails/12.jpg)
SERIES -2
Coming Shortly. Dive into H8 code What’s the fuss about these XML files? Configuration??