SlideShare a Scribd company logo
1 of 39
Object/Relational Mapping Java Persistence API Minor Enterprise Application Development
Understand ORM to use it ,[object Object],[object Object]
“ Modern” ORM Solutions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Entity Beans? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What do RDBs do well? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What do RDBs do badly? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data is important ,[object Object],[object Object]
The Goal ,[object Object],[object Object]
The Real Goal ,[object Object],[object Object]
Impedance Mismatch ,[object Object],[object Object],[object Object],[object Object],[object Object]
Inheritance ,[object Object],[object Object],B a1 C * id a1 * id A * id a1 b1 b1 c1 c1 A * id B * id C * id a1 b1 c1 Table per  class hierarchy Table per class A a1 B b1 C c1
Entity ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Entity Relationships ,[object Object],[object Object],[object Object],[object Object],[object Object]
Entity Manager ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Annotations Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
@Entity / @Table @Entity @Table(name=“PROSPECT”) public class Prospect extends Persistent { ... public Prospect() { ... } } MAUI.PROSPECT PROSPECT_ID NUMBER(18) LAST_UPD_BY NUMBER(18) LAST_UP_TS TIMESTAMP(9) STUDENT_ID NUMBER(18) ... ...
@Id ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
@Basic / @Column ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],MAUI.PROSPECT PROSPECT_ID NUMBER(18) ... ... HS_SELF_REPORTED_CLASS_SIZE NUMBER(5) HS_ANTICIPATED_YR_GRAD CHAR(4) ... ...
@Transient ,[object Object],[object Object]
@Enumerated ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
@Enumerated ... public class Prospect extends Persistent { ... @Enumerated(EnumType.STRING) @Column(name = "PRSP_STATUS_EN") ProspectStatusEnum prospectStatusEnum; ... } MAUI.PROSPECT ... ... PRSP_STATUS_EN VARCHAR(25) ... ...
@ManyToOne ... public class Prospect extends Persistent { @ManyToOne() @JoinColumn(name = "PURGE_SESSION_INFO_ID") private Session purgeSession; ... } @Entity @Table(name = "MAUI.SESSION_INFO") public class Session extends Persistent { ... } MAUI.SESSION_INFO SESSION_INFO_ID NUMBER(18) ... ... MAUI.PROSPECT PROSPECT_ID NUMBER(18) PK ... ... PURGE_SESSION_INFO_ID NUMBER(18) FK
@OneToOne ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],MAUI.STUDENT STUDENT_ID NUMBER(18) PK ... ... MAUI.PROSPECT PROSPECT_ID NUMBER(18) PK ... ... STUDENT_ID NUMBER(18) FK UNIQUE NOT NULL
@OneToMany public class Prospect extends Persistent { ... @OneToMany(mappedBy = &quot;prospect”) private Set<ProspectComment> prospectComments;  } @Entity public class ProspectComment extends Persistent { ... @ManyToOne() @JoinColumn(name = &quot;PROSPECT_ID&quot;) private Prospect prospect; } MAUI.PRSP_COMMENT PRSP_COMMENT_ID NUMBER(18) PK PROSPECT_ID NUMBER(18) FK NOT NULL ... ... MAUI.PROSPECT PROSPECT_ID NUMBER(18) PK ... ...
@MappedSuperclass ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
@Inheritance ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bootstrapping Configuration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
@FetchType  defaults ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
@FetchType  defaults ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
<T> ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Outside-the-container APIs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dynamic queries! ,[object Object],[object Object],[object Object],[object Object]
Ranged queries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
createNamedQuery(String) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
createNamedQuery(String) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Reasons for Object Persistence vs RDB ,[object Object],[object Object],[object Object],[object Object],[object Object]
Reasons For ORM vs OODB ,[object Object],[object Object],[object Object],[object Object],[object Object]
References ,[object Object],[object Object],[object Object]

More Related Content

What's hot

Oracle Sql Developer Data Modeler 3 3 new features
Oracle Sql Developer Data Modeler 3 3 new featuresOracle Sql Developer Data Modeler 3 3 new features
Oracle Sql Developer Data Modeler 3 3 new featuresPhilip Stoyanov
 
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag LibraryIlio Catallo
 
myEquivalents, aka a new cross-reference service
myEquivalents, aka a new cross-reference servicemyEquivalents, aka a new cross-reference service
myEquivalents, aka a new cross-reference serviceRothamsted Research, UK
 
Generic Programming in java
Generic Programming in javaGeneric Programming in java
Generic Programming in javaGarik Kalashyan
 
Extending Schemas
Extending SchemasExtending Schemas
Extending SchemasLiquidHub
 
Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQLLino Valdivia
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statementsİbrahim Kürce
 
Eastman_MI530_FinalProjectReport
Eastman_MI530_FinalProjectReportEastman_MI530_FinalProjectReport
Eastman_MI530_FinalProjectReportNicholas Eastman
 
javasebeyondbasics
javasebeyondbasicsjavasebeyondbasics
javasebeyondbasicswebuploader
 
Effective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All ObjectsEffective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All Objectsİbrahim Kürce
 
XSLT and XPath - without the pain!
XSLT and XPath - without the pain!XSLT and XPath - without the pain!
XSLT and XPath - without the pain!Bertrand Delacretaz
 
Introduction
IntroductionIntroduction
Introductionrichsoden
 
EJB 3.0 Walkthrough (2006)
EJB 3.0 Walkthrough (2006)EJB 3.0 Walkthrough (2006)
EJB 3.0 Walkthrough (2006)Peter Antman
 
Object oriented programming in php 5
Object oriented programming in php 5Object oriented programming in php 5
Object oriented programming in php 5Sayed Ahmed
 

What's hot (20)

Java Generics
Java GenericsJava Generics
Java Generics
 
Plsqlobj
PlsqlobjPlsqlobj
Plsqlobj
 
Oracle Sql Developer Data Modeler 3 3 new features
Oracle Sql Developer Data Modeler 3 3 new featuresOracle Sql Developer Data Modeler 3 3 new features
Oracle Sql Developer Data Modeler 3 3 new features
 
1z0-808-certification-questions-sample
1z0-808-certification-questions-sample1z0-808-certification-questions-sample
1z0-808-certification-questions-sample
 
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag Library
 
myEquivalents, aka a new cross-reference service
myEquivalents, aka a new cross-reference servicemyEquivalents, aka a new cross-reference service
myEquivalents, aka a new cross-reference service
 
Generic Programming in java
Generic Programming in javaGeneric Programming in java
Generic Programming in java
 
Extending Schemas
Extending SchemasExtending Schemas
Extending Schemas
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
Hibernate
HibernateHibernate
Hibernate
 
Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQL
 
J2ee standards > CDI
J2ee standards > CDIJ2ee standards > CDI
J2ee standards > CDI
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
 
Eastman_MI530_FinalProjectReport
Eastman_MI530_FinalProjectReportEastman_MI530_FinalProjectReport
Eastman_MI530_FinalProjectReport
 
javasebeyondbasics
javasebeyondbasicsjavasebeyondbasics
javasebeyondbasics
 
Effective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All ObjectsEffective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All Objects
 
XSLT and XPath - without the pain!
XSLT and XPath - without the pain!XSLT and XPath - without the pain!
XSLT and XPath - without the pain!
 
Introduction
IntroductionIntroduction
Introduction
 
EJB 3.0 Walkthrough (2006)
EJB 3.0 Walkthrough (2006)EJB 3.0 Walkthrough (2006)
EJB 3.0 Walkthrough (2006)
 
Object oriented programming in php 5
Object oriented programming in php 5Object oriented programming in php 5
Object oriented programming in php 5
 

Viewers also liked

Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPASubin Sugunan
 
Graduación 2º bachillerato 2016
Graduación 2º bachillerato 2016Graduación 2º bachillerato 2016
Graduación 2º bachillerato 2016isabelri
 
Hibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance TechniquesHibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance TechniquesBrett Meyer
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewBrett Meyer
 
Overview of JPA (Java Persistence API) v2.0
Overview of JPA (Java Persistence API) v2.0Overview of JPA (Java Persistence API) v2.0
Overview of JPA (Java Persistence API) v2.0Bryan Basham
 

Viewers also liked (6)

Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
 
Graduación 2º bachillerato 2016
Graduación 2º bachillerato 2016Graduación 2º bachillerato 2016
Graduación 2º bachillerato 2016
 
Thinking Beyond ORM in JPA
Thinking Beyond ORM in JPAThinking Beyond ORM in JPA
Thinking Beyond ORM in JPA
 
Hibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance TechniquesHibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance Techniques
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate Overview
 
Overview of JPA (Java Persistence API) v2.0
Overview of JPA (Java Persistence API) v2.0Overview of JPA (Java Persistence API) v2.0
Overview of JPA (Java Persistence API) v2.0
 

Similar to ORM JPA

Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreIMC Institute
 
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...Baruch Sadogursky
 
2008.07.17 발표
2008.07.17 발표2008.07.17 발표
2008.07.17 발표Sunjoo Park
 
Accelerated data access
Accelerated data accessAccelerated data access
Accelerated data accessgordonyorke
 
Slice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistenceSlice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistencePinaki Poddar
 
Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Pinaki Poddar
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 
Querydsl fin jug - june 2012
Querydsl   fin jug - june 2012Querydsl   fin jug - june 2012
Querydsl fin jug - june 2012Timo Westkämper
 
Java one 2010
Java one 2010Java one 2010
Java one 2010scdn
 
Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)David McCarter
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalystdwm042
 
Nhibernatethe Orm For Net Platform 1226744632929962 8
Nhibernatethe Orm For Net Platform 1226744632929962 8Nhibernatethe Orm For Net Platform 1226744632929962 8
Nhibernatethe Orm For Net Platform 1226744632929962 8Nicolas Thon
 
Learn java
Learn javaLearn java
Learn javaPalahuja
 

Similar to ORM JPA (20)

Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : Datastore
 
Introduction to Datastore
Introduction to DatastoreIntroduction to Datastore
Introduction to Datastore
 
Struts2
Struts2Struts2
Struts2
 
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...
Persisting Your Objects In The Database World @ AlphaCSP Professional OSS Con...
 
2008.07.17 발표
2008.07.17 발표2008.07.17 발표
2008.07.17 발표
 
Accelerated data access
Accelerated data accessAccelerated data access
Accelerated data access
 
Slice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistenceSlice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed Persistence
 
JPA 2.0
JPA 2.0JPA 2.0
JPA 2.0
 
JavaEE Spring Seam
JavaEE Spring SeamJavaEE Spring Seam
JavaEE Spring Seam
 
Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)
 
Basic Hibernate Final
Basic Hibernate FinalBasic Hibernate Final
Basic Hibernate Final
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Querydsl fin jug - june 2012
Querydsl   fin jug - june 2012Querydsl   fin jug - june 2012
Querydsl fin jug - june 2012
 
Java one 2010
Java one 2010Java one 2010
Java one 2010
 
Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
Nhibernatethe Orm For Net Platform 1226744632929962 8
Nhibernatethe Orm For Net Platform 1226744632929962 8Nhibernatethe Orm For Net Platform 1226744632929962 8
Nhibernatethe Orm For Net Platform 1226744632929962 8
 
Learn java
Learn javaLearn java
Learn java
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
 
Os Leonard
Os LeonardOs Leonard
Os Leonard
 

More from Rody Middelkoop

Integration and Unit Testing in Java using Test Doubles like mocks and stubs
Integration and Unit Testing in Java using Test Doubles like mocks and stubsIntegration and Unit Testing in Java using Test Doubles like mocks and stubs
Integration and Unit Testing in Java using Test Doubles like mocks and stubsRody Middelkoop
 
An agile mindset in education
An agile mindset in education An agile mindset in education
An agile mindset in education Rody Middelkoop
 
Eduscrum presentatie Scrum event 2016: Scrum als onderwijsaanpak
Eduscrum presentatie Scrum event 2016: Scrum als onderwijsaanpakEduscrum presentatie Scrum event 2016: Scrum als onderwijsaanpak
Eduscrum presentatie Scrum event 2016: Scrum als onderwijsaanpakRody Middelkoop
 
Pecha Kucha eduScrum Agile Education
Pecha Kucha eduScrum Agile EducationPecha Kucha eduScrum Agile Education
Pecha Kucha eduScrum Agile EducationRody Middelkoop
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android ApplicationsRody Middelkoop
 
Softwarekwaliteit in een ontwikkelstraat
Softwarekwaliteit in een ontwikkelstraatSoftwarekwaliteit in een ontwikkelstraat
Softwarekwaliteit in een ontwikkelstraatRody Middelkoop
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.jsRody Middelkoop
 
DDOA = Software Craftmanship
DDOA = Software CraftmanshipDDOA = Software Craftmanship
DDOA = Software CraftmanshipRody Middelkoop
 
Back to the Future: Onderwijs van 1991 tot 2031
Back to the Future: Onderwijs van 1991 tot 2031Back to the Future: Onderwijs van 1991 tot 2031
Back to the Future: Onderwijs van 1991 tot 2031Rody Middelkoop
 
Scrum implemented in an educational context
Scrum implemented in an educational contextScrum implemented in an educational context
Scrum implemented in an educational contextRody Middelkoop
 
Pragmatic Model Driven Development In Java Using Smart Use Cases
Pragmatic Model Driven Development In Java Using Smart Use CasesPragmatic Model Driven Development In Java Using Smart Use Cases
Pragmatic Model Driven Development In Java Using Smart Use CasesRody Middelkoop
 
Scrum in informaticaonderwijs
Scrum in informaticaonderwijsScrum in informaticaonderwijs
Scrum in informaticaonderwijsRody Middelkoop
 
Saas: Software AND Service
Saas: Software AND ServiceSaas: Software AND Service
Saas: Software AND ServiceRody Middelkoop
 
Service Analysis And Design
Service Analysis And DesignService Analysis And Design
Service Analysis And DesignRody Middelkoop
 
Contract First Modeling Services Using Uml
Contract First Modeling Services Using UmlContract First Modeling Services Using Uml
Contract First Modeling Services Using UmlRody Middelkoop
 

More from Rody Middelkoop (19)

Integration and Unit Testing in Java using Test Doubles like mocks and stubs
Integration and Unit Testing in Java using Test Doubles like mocks and stubsIntegration and Unit Testing in Java using Test Doubles like mocks and stubs
Integration and Unit Testing in Java using Test Doubles like mocks and stubs
 
An agile mindset in education
An agile mindset in education An agile mindset in education
An agile mindset in education
 
Themalunch scrum
Themalunch scrumThemalunch scrum
Themalunch scrum
 
Eduscrum presentatie Scrum event 2016: Scrum als onderwijsaanpak
Eduscrum presentatie Scrum event 2016: Scrum als onderwijsaanpakEduscrum presentatie Scrum event 2016: Scrum als onderwijsaanpak
Eduscrum presentatie Scrum event 2016: Scrum als onderwijsaanpak
 
Pecha Kucha eduScrum Agile Education
Pecha Kucha eduScrum Agile EducationPecha Kucha eduScrum Agile Education
Pecha Kucha eduScrum Agile Education
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android Applications
 
Software Process Models
Software Process ModelsSoftware Process Models
Software Process Models
 
Softwarekwaliteit in een ontwikkelstraat
Softwarekwaliteit in een ontwikkelstraatSoftwarekwaliteit in een ontwikkelstraat
Softwarekwaliteit in een ontwikkelstraat
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.js
 
DDOA = Software Craftmanship
DDOA = Software CraftmanshipDDOA = Software Craftmanship
DDOA = Software Craftmanship
 
Back to the Future: Onderwijs van 1991 tot 2031
Back to the Future: Onderwijs van 1991 tot 2031Back to the Future: Onderwijs van 1991 tot 2031
Back to the Future: Onderwijs van 1991 tot 2031
 
Scrum implemented in an educational context
Scrum implemented in an educational contextScrum implemented in an educational context
Scrum implemented in an educational context
 
Ajax And JSON
Ajax And JSONAjax And JSON
Ajax And JSON
 
OO JavaScript
OO JavaScriptOO JavaScript
OO JavaScript
 
Pragmatic Model Driven Development In Java Using Smart Use Cases
Pragmatic Model Driven Development In Java Using Smart Use CasesPragmatic Model Driven Development In Java Using Smart Use Cases
Pragmatic Model Driven Development In Java Using Smart Use Cases
 
Scrum in informaticaonderwijs
Scrum in informaticaonderwijsScrum in informaticaonderwijs
Scrum in informaticaonderwijs
 
Saas: Software AND Service
Saas: Software AND ServiceSaas: Software AND Service
Saas: Software AND Service
 
Service Analysis And Design
Service Analysis And DesignService Analysis And Design
Service Analysis And Design
 
Contract First Modeling Services Using Uml
Contract First Modeling Services Using UmlContract First Modeling Services Using Uml
Contract First Modeling Services Using Uml
 

ORM JPA

  • 1. Object/Relational Mapping Java Persistence API Minor Enterprise Application Development
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. @Entity / @Table @Entity @Table(name=“PROSPECT”) public class Prospect extends Persistent { ... public Prospect() { ... } } MAUI.PROSPECT PROSPECT_ID NUMBER(18) LAST_UPD_BY NUMBER(18) LAST_UP_TS TIMESTAMP(9) STUDENT_ID NUMBER(18) ... ...
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. @Enumerated ... public class Prospect extends Persistent { ... @Enumerated(EnumType.STRING) @Column(name = &quot;PRSP_STATUS_EN&quot;) ProspectStatusEnum prospectStatusEnum; ... } MAUI.PROSPECT ... ... PRSP_STATUS_EN VARCHAR(25) ... ...
  • 23. @ManyToOne ... public class Prospect extends Persistent { @ManyToOne() @JoinColumn(name = &quot;PURGE_SESSION_INFO_ID&quot;) private Session purgeSession; ... } @Entity @Table(name = &quot;MAUI.SESSION_INFO&quot;) public class Session extends Persistent { ... } MAUI.SESSION_INFO SESSION_INFO_ID NUMBER(18) ... ... MAUI.PROSPECT PROSPECT_ID NUMBER(18) PK ... ... PURGE_SESSION_INFO_ID NUMBER(18) FK
  • 24.
  • 25. @OneToMany public class Prospect extends Persistent { ... @OneToMany(mappedBy = &quot;prospect”) private Set<ProspectComment> prospectComments; } @Entity public class ProspectComment extends Persistent { ... @ManyToOne() @JoinColumn(name = &quot;PROSPECT_ID&quot;) private Prospect prospect; } MAUI.PRSP_COMMENT PRSP_COMMENT_ID NUMBER(18) PK PROSPECT_ID NUMBER(18) FK NOT NULL ... ... MAUI.PROSPECT PROSPECT_ID NUMBER(18) PK ... ...
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.