hibernate an introduction

13
Hibernate an introduction José Luis Muñoz Jun 12, 2012

Upload: joseluismms

Post on 15-Jul-2015

68 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Hibernate   an introduction

Hibernate an introduction

José Luis Muñoz

Jun 12, 2012

Page 2: Hibernate   an introduction

Contents 1

1. Problem, Software history

2. Advantages ORM (Object Relation Mapping)

3. How it works (high level vision)

4. Relation: Eclipse – DataBase – Hibernate

5. Configuration file cfg.xml

6. Mapping files

7. Object States

8. Example

Page 3: Hibernate   an introduction

Problem, Software history 2

1. SQL sentences into code

Business Classes Data Base

2. DAO Architecture

Business Classes DAO

SQL

Data Base

Page 4: Hibernate   an introduction

Problem, Software history 3

3. Mapping problem

Business Classes Data Base

Public class Employee { private String name; }

TABLE Employee ( VARCHAR2(50) NAME, )

Page 5: Hibernate   an introduction

Advantages ORM (Object Relation Mapping) 4

Advantages: - Complete database abstraction - IDE mapping generated for objects-tables relation

- Automatic state change

- Easy configurable through xml

- Implements JPA (Java Persistence Api) standar

Page 6: Hibernate   an introduction

How it works (high level) 5

Page 7: Hibernate   an introduction

How it works (high level more detail) 6

Page 8: Hibernate   an introduction

Relation: Eclipse – DataBase – Hibernate 7

Eclipse

Hibernate

Data Base

Data base connection

User Library Configuration file

Page 9: Hibernate   an introduction

Configuration file cfg.xml 8

Hibernate dialect

Page 10: Hibernate   an introduction

Mapping files 9

http://www.slideshare.net/rahuldausa/hibernate-for-beginners

Page 11: Hibernate   an introduction

Object States 10

Page 12: Hibernate   an introduction

Example (state change) 11

Methods: save(Object.class )

Page 13: Hibernate   an introduction

The End 12

[email protected]