hibernate(h8) in action

12
HIBERNATE(H8) IN ACTION Priyank Kapadia

Upload: priyank

Post on 18-Jul-2015

2.185 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Hibernate(H8) In Action

HIBERNATE(H8) IN ACTIONPriyank Kapadia

Page 2: Hibernate(H8) In Action

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

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

PERSISTENCE CLASS

Page 5: Hibernate(H8) In Action

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

ORM VISUALIZED

Page 7: Hibernate(H8) In Action

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

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

HIBERNATE SIMPLIFIED

• H8 is between the DB & code

•Maps Persistent objects to tables

Page 10: Hibernate(H8) In Action

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

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

SERIES -2

Coming Shortly. Dive into H8 code What’s the fuss about these XML files? Configuration??