中国高校课件下载中心 》 教学资源 》 大学文库

复旦大学:《面向对象分析和设计》课程资料_UML和模式_Hibernate Persistence

文档信息
资源类别:文库
文档格式:PPT
文档页数:34
文件大小:284KB
团购合买:点击进入团购
内容简介
复旦大学:《面向对象分析和设计》课程资料_UML和模式_Hibernate Persistence
刷新页面文档预览

Hibernate persistence

Hibernate Persistence

What is persistence persist data to database or other storage a In Oo world, persistence means persist object to external storage Relational database SQL a Using SQL in Java a Persistence object-oriented applications: ORM

What is Persistence ◼ Persist data to database or other storage. ❑ In OO world, persistence means persist object to external storage. ◼ Relational database ❑ SQL ❑ Using SQL in Java ❑ Persistence object-oriented applications: ORM

What is Hibernate? Popular Open Source(LGPL) Object/Relational Mapping(oRM) tool Transparent persistence for POJOs (Plain Old Java objects Core of JBoss Cmp 2.0 impl

What is Hibernate? ◼ Popular Open Source (LGPL) Object/Relational Mapping (ORM) tool ◼ Transparent persistence for POJOs (Plain Old Java Objects) ◼ Core of JBoss CMP 2.0 impl

Why Hibernate? Minimizes code Does not require a container Model is not tied to persistence implementation, Retains natural object model (transparent)

Why Hibernate? • Minimizes Code • Does not require a container • Model is not tied to persistence implementation, Retains natural object model (transparent)

Object/Relational Mapping Javaobject SOL Table int id; string namei string getName( id [int] primary key, int getId() void setName(string) name [varchar(50) void setId(int) Magic Happens Here (O/R Mapper-1e Hibernate)

Object/Relational Mapping JavaObject int id; String name; String getName() int getId() void setName(String) void setId(int) SQL Table id [int] primary key, name [varchar(50)] Magic Happens Here (O/R Mapper – i.e. Hibernate)

Course ob Ject Model > Gender female ma⊥e +course Course eacher tname tname string +totalStudent s > Address +postCode Normalcourse OnlineCours +classroomname tURL

Course Object Model

Persistence tasks Class mapping a Class to Table mapping a Object id to Primary Key Attribute Mapping a Primary Attribute to column a User defined data type to embedded type Inheritance Mapping Relationship Mapping a One to Many a many to one

Persistence Tasks ◼ Class mapping ❑ Class to Table mapping ❑ Object ID to Primary Key ◼ Attribute Mapping ❑ Primary Attribute to Column ❑ User defined data type to embedded type ◼ Inheritance Mapping ◼ Relationship Mapping ❑ One to Many ❑ Many to One

Persistence/ Concurrency Pattern Introduced Martin fowlery《企业应用架构模式》

Persistence /Concurrency Pattern Introduced Martin Fowler《企业应用架构模式》

Persistence What is persistence a Why Persistence is Importance History of persistence a Plan text 口RDB(OODB? D XML

Persistence ◼ What is Persistence ◼ Why Persistence is Importance ◼ History of persistence ❑ Plan text ❑ RDB(OODB?) ❑ XML

Mapping to a relational database Metadata Mapping Identity Field lazy load Query Object

Mapping to a Relational Database ◼ Metadata Mapping ◼ Identity Field ◼ Lazy Load ◼ Query Object

刷新页面下载完整文档
VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
相关文档