SlideShare a Scribd company logo
Session 5 Introduction to Entity Beans
Session Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object]
Review of Session 4 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Persistence Persistence Java Object  Serialization Three ways to make an object persistent Object Relational Mapping Object database  Persistence Storage Obj 1 Obj 2 Persistence  Objects Storage Storage Database
Java Object Serialization Object 1 Object 2 Object n State of the object Compact representation  Marshall an object graph into a compact representation Serialization of object graph into byte stream Developer pushes data over the network or saves the stream to a storage Byte Stream
Object Relational Mapping Database API Relational  Database Manual Mapping Use an Object- Relational Mapping Product Object   Travel Account String Name String TktNo Double Amount
Object Database Persistence ,[object Object],[object Object],[object Object],[object Object]
Components deployed in Multi-tier Deployment- Application logic components   Application logic components are components that provide methods which perform common tasks Computing the price of a ticket Billing of products
Components deployed in Multi-tier Deployment  -  Persistent Data Components Object Serialization of data Database Examples are air ticket information such as ticket number and amount Employee data such as salaries and place of work
Files in an Entity bean Entity  Bean Remote  Interface Primary  Key  Class Entity  Bean  Class Deployment  Descriptors Home  Interface Local  Interfaces
Entity Bean class Models  Java  Class Persistent Data Maps Database  Schema Entity Definition For  example , an entity bean class can map to a  relational table definition. An entity bean instance of that class will then map to a row in that table.
The Entity Bean’s Remote Interface Client Entity Bean Invokes Business Method signatures Remote Interface
The Home Interface create find destroy The home interface is used by the clients to create, find and destroy entity bean objects. Client Uses Methods Home Interface Entity Bean Object Entity Bean Object Entity Bean Object
Local Interface Local Clients Entity Beans Methods Entity Beans Exposes Local Interface allows the beans to expose its methods to other beans that reside within the same container (local clients).  Container
The Primary Key Class ,[object Object],[object Object],[object Object],[object Object]
The Deployment Descriptors Container Deployment descriptors List of properties Contacts the deployment descriptor for bean deployment  Informs the container about the bean and classes
Pooling of Entity Bean Instances EJB Container Entity Bean 1 Entity Bean 2 Entity Bean n Instantiates Storage Data 1 Data 2 Data n Represents Entity Beans Pooled and Recycled Entity Bean 1 When the bean instance is used ,it is assigned to handle different client request.
Ways to Persist Entity Beans Data Store Entity Bean Entity Beans map themselves in the  data store Bean-managed Persistence Container- Managed Persistence Deployment Descriptor Persistent Beans Deployment Descriptor tells the container about the persistent fields and then the container handles the data logic
Working with Entity Beans ,[object Object],[object Object],[object Object],[object Object]
Modifying Entity Beans Directly though the Database EJB Container/ Server Entity Beans Existing Application Database O/R Mapping Direct Database Modifications Bean data
Developing and Using Entity Beans ,[object Object],* setEntityContext(javax.ejb.EntityContext) * unsetEntityContext() * ejbRemove() * ejbActivate() * ejbPassivate() * ejbLoad() * ejbStore()
ejbCreate( ) ,[object Object],[object Object],[object Object]
ejbFind ( )  Creating a BMP EJB and an EJB object Home object EJB object Entity bean instance EJB Container/ Server 1.  Call create() 6. Returns object to the client 2. Call ejbCreate() 4.  Returns primary key  Client Code 3. Create database data 5.  Create EJB object
ejbFind ( ) - rules ,[object Object],[object Object],[object Object],[object Object],[object Object]
ejbRemove( ) - I ,[object Object],[object Object],[object Object]
ejbRemove( )- II Destroying an entity bean’s data representation   Home object EJB object Entity bean instance EJB Container/ Server 1.  Call remove() 2. Call ejbRemove() Client Code 3. Remove database data 1.  Call remove() 2. Call ejbRemove()
Entity Contexts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Message-Driven Beans ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Uses of Message-Driven Beans ,[object Object],[object Object],[object Object],[object Object]
Implementation of Message Beans ,[object Object],[object Object]
Summary - 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary -2  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary -3 ,[object Object],[object Object]

More Related Content

What's hot

Hibernate II
Hibernate IIHibernate II
Hibernate II
People Strategists
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
Niit Care
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
Niit Care
 
Java beans
Java beansJava beans
Hibernate An Introduction
Hibernate An IntroductionHibernate An Introduction
Hibernate An Introduction
Nguyen Cao
 
JPA For Beginner's
JPA For Beginner'sJPA For Beginner's
JPA For Beginner's
NarayanaMurthy Ganashree
 
JPA Best Practices
JPA Best PracticesJPA Best Practices
JPA Best Practices
Carol McDonald
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
Guo Albert
 
Hibernate
HibernateHibernate
Hibernate
Prashant Kalkar
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Training
sourabh aggarwal
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
Niit Care
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate Tutorial
Ram132
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
Mohammad Faizan
 
Ecom lec4 fall16_jpa
Ecom lec4 fall16_jpaEcom lec4 fall16_jpa
Ecom lec4 fall16_jpa
Zainab Khallouf
 
Hibernate in Action
Hibernate in ActionHibernate in Action
Hibernate in Action
Akshay Ballarpure
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
Subin Sugunan
 
java drag and drop and data transfer
java drag and drop and data transferjava drag and drop and data transfer
java drag and drop and data transfer
Ankit Desai
 
Jpa 2.1 Application Development
Jpa 2.1 Application DevelopmentJpa 2.1 Application Development
Jpa 2.1 Application Development
ThirupathiReddy Vajjala
 
Advanced core java
Advanced core javaAdvanced core java
Advanced core java
Rajeev Uppala
 
Advance Java Practical file
Advance Java Practical fileAdvance Java Practical file
Advance Java Practical file
varun arora
 

What's hot (20)

Hibernate II
Hibernate IIHibernate II
Hibernate II
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Java beans
Java beansJava beans
Java beans
 
Hibernate An Introduction
Hibernate An IntroductionHibernate An Introduction
Hibernate An Introduction
 
JPA For Beginner's
JPA For Beginner'sJPA For Beginner's
JPA For Beginner's
 
JPA Best Practices
JPA Best PracticesJPA Best Practices
JPA Best Practices
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 
Hibernate
HibernateHibernate
Hibernate
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Training
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate Tutorial
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
 
Ecom lec4 fall16_jpa
Ecom lec4 fall16_jpaEcom lec4 fall16_jpa
Ecom lec4 fall16_jpa
 
Hibernate in Action
Hibernate in ActionHibernate in Action
Hibernate in Action
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
 
java drag and drop and data transfer
java drag and drop and data transferjava drag and drop and data transfer
java drag and drop and data transfer
 
Jpa 2.1 Application Development
Jpa 2.1 Application DevelopmentJpa 2.1 Application Development
Jpa 2.1 Application Development
 
Advanced core java
Advanced core javaAdvanced core java
Advanced core java
 
Advance Java Practical file
Advance Java Practical fileAdvance Java Practical file
Advance Java Practical file
 

Viewers also liked

Entity beans in java
Entity beans in javaEntity beans in java
Entity beans in java
Acp Jamod
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJB
Peter R. Egli
 
Ejb3 Presentation
Ejb3 PresentationEjb3 Presentation
Ejb3 Presentation
Saurabh Raisinghani
 
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
BG Java EE Course
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business Logic
Emprovise
 
JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharing
vikram singh
 
Java bean
Java beanJava bean
Java bean
Jafar Nesargi
 
Introduction to EJB
Introduction to EJBIntroduction to EJB
Introduction to EJB
Return on Intelligence
 
EJB3 Basics
EJB3 BasicsEJB3 Basics
EJB3 Basics
Emprovise
 
Jsp
JspJsp
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
Chitrank Dixit
 
Jsp Introduction Tutorial
Jsp Introduction TutorialJsp Introduction Tutorial
Jsp Introduction Tutorial
APSMIND TECHNOLOGY PVT LTD.
 
JSP
JSPJSP
Jsp chapter 1
Jsp chapter 1Jsp chapter 1
Jsp chapter 1
kamal kotecha
 
EJB .
EJB .EJB .
Lecture 1: Introduction to JEE
Lecture 1:  Introduction to JEELecture 1:  Introduction to JEE
Lecture 1: Introduction to JEE
Fahad Golra
 
Lecture 8 Enterprise Java Beans (EJB)
Lecture 8  Enterprise Java Beans (EJB)Lecture 8  Enterprise Java Beans (EJB)
Lecture 8 Enterprise Java Beans (EJB)
Fahad Golra
 
Jsp presentation
Jsp presentationJsp presentation
Jsp presentation
Sher Singh Bardhan
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
Vikas Jagtap
 
Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)
Armen Arzumanyan
 

Viewers also liked (20)

Entity beans in java
Entity beans in javaEntity beans in java
Entity beans in java
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJB
 
Ejb3 Presentation
Ejb3 PresentationEjb3 Presentation
Ejb3 Presentation
 
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business Logic
 
JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharing
 
Java bean
Java beanJava bean
Java bean
 
Introduction to EJB
Introduction to EJBIntroduction to EJB
Introduction to EJB
 
EJB3 Basics
EJB3 BasicsEJB3 Basics
EJB3 Basics
 
Jsp
JspJsp
Jsp
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
 
Jsp Introduction Tutorial
Jsp Introduction TutorialJsp Introduction Tutorial
Jsp Introduction Tutorial
 
JSP
JSPJSP
JSP
 
Jsp chapter 1
Jsp chapter 1Jsp chapter 1
Jsp chapter 1
 
EJB .
EJB .EJB .
EJB .
 
Lecture 1: Introduction to JEE
Lecture 1:  Introduction to JEELecture 1:  Introduction to JEE
Lecture 1: Introduction to JEE
 
Lecture 8 Enterprise Java Beans (EJB)
Lecture 8  Enterprise Java Beans (EJB)Lecture 8  Enterprise Java Beans (EJB)
Lecture 8 Enterprise Java Beans (EJB)
 
Jsp presentation
Jsp presentationJsp presentation
Jsp presentation
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)
 

Similar to Session 5 Tp5

Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3
phanleson
 
Ejb - september 2006
Ejb  - september 2006Ejb  - september 2006
Ejb - september 2006
achraf_ing
 
Ejb 2.0
Ejb 2.0Ejb 2.0
Ejb 2.0
sukace
 
EJB Interview Questions
EJB Interview QuestionsEJB Interview Questions
EJB Interview Questions
guest346cb1
 
EJB3 Advance Features
EJB3 Advance FeaturesEJB3 Advance Features
EJB3 Advance Features
Emprovise
 
EJB Clients
EJB ClientsEJB Clients
EJB Clients
Roy Antony Arnold G
 
Ch4 ejb
Ch4 ejbCh4 ejb
Ejb intro
Ejb introEjb intro
Ejb intro
MANOJ KUMAR
 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3
Rajiv Gupta
 
Ejb intro
Ejb introEjb intro
Ejb intro
vantinhkhuc
 
02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions
Dhiraj Champawat
 
Session 4 Tp4
Session 4 Tp4Session 4 Tp4
Session 4 Tp4
phanleson
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
rani marri
 
Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecture
tayab4687
 
CommercialSystemsBahman.ppt
CommercialSystemsBahman.pptCommercialSystemsBahman.ppt
CommercialSystemsBahman.ppt
KalsoomTahir2
 
Hibernate Session 1
Hibernate Session 1Hibernate Session 1
Hibernate Session 1
b_kathir
 
Rmi, corba and java beans
Rmi, corba and java beansRmi, corba and java beans
Rmi, corba and java beans
Raghu nath
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
Aneega
 
J2 Ee Overview
J2 Ee OverviewJ2 Ee Overview
J2 Ee Overview
Atul Shridhar
 
J2EE - Practical Overview
J2EE - Practical OverviewJ2EE - Practical Overview
J2EE - Practical Overview
Svetlin Nakov
 

Similar to Session 5 Tp5 (20)

Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3
 
Ejb - september 2006
Ejb  - september 2006Ejb  - september 2006
Ejb - september 2006
 
Ejb 2.0
Ejb 2.0Ejb 2.0
Ejb 2.0
 
EJB Interview Questions
EJB Interview QuestionsEJB Interview Questions
EJB Interview Questions
 
EJB3 Advance Features
EJB3 Advance FeaturesEJB3 Advance Features
EJB3 Advance Features
 
EJB Clients
EJB ClientsEJB Clients
EJB Clients
 
Ch4 ejb
Ch4 ejbCh4 ejb
Ch4 ejb
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions
 
Session 4 Tp4
Session 4 Tp4Session 4 Tp4
Session 4 Tp4
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
 
Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecture
 
CommercialSystemsBahman.ppt
CommercialSystemsBahman.pptCommercialSystemsBahman.ppt
CommercialSystemsBahman.ppt
 
Hibernate Session 1
Hibernate Session 1Hibernate Session 1
Hibernate Session 1
 
Rmi, corba and java beans
Rmi, corba and java beansRmi, corba and java beans
Rmi, corba and java beans
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
 
J2 Ee Overview
J2 Ee OverviewJ2 Ee Overview
J2 Ee Overview
 
J2EE - Practical Overview
J2EE - Practical OverviewJ2EE - Practical Overview
J2EE - Practical Overview
 

More from phanleson

Learning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with SparkLearning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with Spark
phanleson
 
Firewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth FirewallsFirewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth Firewalls
phanleson
 
Mobile Security - Wireless hacking
Mobile Security - Wireless hackingMobile Security - Wireless hacking
Mobile Security - Wireless hacking
phanleson
 
Authentication in wireless - Security in Wireless Protocols
Authentication in wireless - Security in Wireless ProtocolsAuthentication in wireless - Security in Wireless Protocols
Authentication in wireless - Security in Wireless Protocols
phanleson
 
E-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server AttacksE-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server Attacks
phanleson
 
Hacking web applications
Hacking web applicationsHacking web applications
Hacking web applications
phanleson
 
HBase In Action - Chapter 04: HBase table design
HBase In Action - Chapter 04: HBase table designHBase In Action - Chapter 04: HBase table design
HBase In Action - Chapter 04: HBase table design
phanleson
 
HBase In Action - Chapter 10 - Operations
HBase In Action - Chapter 10 - OperationsHBase In Action - Chapter 10 - Operations
HBase In Action - Chapter 10 - Operations
phanleson
 
Hbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBaseHbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBase
phanleson
 
Learning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlibLearning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlib
phanleson
 
Learning spark ch10 - Spark Streaming
Learning spark ch10 - Spark StreamingLearning spark ch10 - Spark Streaming
Learning spark ch10 - Spark Streaming
phanleson
 
Learning spark ch09 - Spark SQL
Learning spark ch09 - Spark SQLLearning spark ch09 - Spark SQL
Learning spark ch09 - Spark SQL
phanleson
 
Learning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a ClusterLearning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a Cluster
phanleson
 
Learning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark ProgrammingLearning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark Programming
phanleson
 
Learning spark ch05 - Loading and Saving Your Data
Learning spark ch05 - Loading and Saving Your DataLearning spark ch05 - Loading and Saving Your Data
Learning spark ch05 - Loading and Saving Your Data
phanleson
 
Learning spark ch04 - Working with Key/Value Pairs
Learning spark ch04 - Working with Key/Value PairsLearning spark ch04 - Working with Key/Value Pairs
Learning spark ch04 - Working with Key/Value Pairs
phanleson
 
Learning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with SparkLearning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with Spark
phanleson
 
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about LibertagiaHướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
phanleson
 
Lecture 1 - Getting to know XML
Lecture 1 - Getting to know XMLLecture 1 - Getting to know XML
Lecture 1 - Getting to know XML
phanleson
 
Lecture 4 - Adding XTHML for the Web
Lecture  4 - Adding XTHML for the WebLecture  4 - Adding XTHML for the Web
Lecture 4 - Adding XTHML for the Web
phanleson
 

More from phanleson (20)

Learning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with SparkLearning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with Spark
 
Firewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth FirewallsFirewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth Firewalls
 
Mobile Security - Wireless hacking
Mobile Security - Wireless hackingMobile Security - Wireless hacking
Mobile Security - Wireless hacking
 
Authentication in wireless - Security in Wireless Protocols
Authentication in wireless - Security in Wireless ProtocolsAuthentication in wireless - Security in Wireless Protocols
Authentication in wireless - Security in Wireless Protocols
 
E-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server AttacksE-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server Attacks
 
Hacking web applications
Hacking web applicationsHacking web applications
Hacking web applications
 
HBase In Action - Chapter 04: HBase table design
HBase In Action - Chapter 04: HBase table designHBase In Action - Chapter 04: HBase table design
HBase In Action - Chapter 04: HBase table design
 
HBase In Action - Chapter 10 - Operations
HBase In Action - Chapter 10 - OperationsHBase In Action - Chapter 10 - Operations
HBase In Action - Chapter 10 - Operations
 
Hbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBaseHbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBase
 
Learning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlibLearning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlib
 
Learning spark ch10 - Spark Streaming
Learning spark ch10 - Spark StreamingLearning spark ch10 - Spark Streaming
Learning spark ch10 - Spark Streaming
 
Learning spark ch09 - Spark SQL
Learning spark ch09 - Spark SQLLearning spark ch09 - Spark SQL
Learning spark ch09 - Spark SQL
 
Learning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a ClusterLearning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a Cluster
 
Learning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark ProgrammingLearning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark Programming
 
Learning spark ch05 - Loading and Saving Your Data
Learning spark ch05 - Loading and Saving Your DataLearning spark ch05 - Loading and Saving Your Data
Learning spark ch05 - Loading and Saving Your Data
 
Learning spark ch04 - Working with Key/Value Pairs
Learning spark ch04 - Working with Key/Value PairsLearning spark ch04 - Working with Key/Value Pairs
Learning spark ch04 - Working with Key/Value Pairs
 
Learning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with SparkLearning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with Spark
 
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about LibertagiaHướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
 
Lecture 1 - Getting to know XML
Lecture 1 - Getting to know XMLLecture 1 - Getting to know XML
Lecture 1 - Getting to know XML
 
Lecture 4 - Adding XTHML for the Web
Lecture  4 - Adding XTHML for the WebLecture  4 - Adding XTHML for the Web
Lecture 4 - Adding XTHML for the Web
 

Recently uploaded

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 

Recently uploaded (20)

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 

Session 5 Tp5

  • 1. Session 5 Introduction to Entity Beans
  • 2.
  • 3.
  • 4. Persistence Persistence Java Object Serialization Three ways to make an object persistent Object Relational Mapping Object database Persistence Storage Obj 1 Obj 2 Persistence Objects Storage Storage Database
  • 5. Java Object Serialization Object 1 Object 2 Object n State of the object Compact representation Marshall an object graph into a compact representation Serialization of object graph into byte stream Developer pushes data over the network or saves the stream to a storage Byte Stream
  • 6. Object Relational Mapping Database API Relational Database Manual Mapping Use an Object- Relational Mapping Product Object Travel Account String Name String TktNo Double Amount
  • 7.
  • 8. Components deployed in Multi-tier Deployment- Application logic components Application logic components are components that provide methods which perform common tasks Computing the price of a ticket Billing of products
  • 9. Components deployed in Multi-tier Deployment - Persistent Data Components Object Serialization of data Database Examples are air ticket information such as ticket number and amount Employee data such as salaries and place of work
  • 10. Files in an Entity bean Entity Bean Remote Interface Primary Key Class Entity Bean Class Deployment Descriptors Home Interface Local Interfaces
  • 11. Entity Bean class Models Java Class Persistent Data Maps Database Schema Entity Definition For example , an entity bean class can map to a relational table definition. An entity bean instance of that class will then map to a row in that table.
  • 12. The Entity Bean’s Remote Interface Client Entity Bean Invokes Business Method signatures Remote Interface
  • 13. The Home Interface create find destroy The home interface is used by the clients to create, find and destroy entity bean objects. Client Uses Methods Home Interface Entity Bean Object Entity Bean Object Entity Bean Object
  • 14. Local Interface Local Clients Entity Beans Methods Entity Beans Exposes Local Interface allows the beans to expose its methods to other beans that reside within the same container (local clients). Container
  • 15.
  • 16. The Deployment Descriptors Container Deployment descriptors List of properties Contacts the deployment descriptor for bean deployment Informs the container about the bean and classes
  • 17. Pooling of Entity Bean Instances EJB Container Entity Bean 1 Entity Bean 2 Entity Bean n Instantiates Storage Data 1 Data 2 Data n Represents Entity Beans Pooled and Recycled Entity Bean 1 When the bean instance is used ,it is assigned to handle different client request.
  • 18. Ways to Persist Entity Beans Data Store Entity Bean Entity Beans map themselves in the data store Bean-managed Persistence Container- Managed Persistence Deployment Descriptor Persistent Beans Deployment Descriptor tells the container about the persistent fields and then the container handles the data logic
  • 19.
  • 20. Modifying Entity Beans Directly though the Database EJB Container/ Server Entity Beans Existing Application Database O/R Mapping Direct Database Modifications Bean data
  • 21.
  • 22.
  • 23. ejbFind ( ) Creating a BMP EJB and an EJB object Home object EJB object Entity bean instance EJB Container/ Server 1. Call create() 6. Returns object to the client 2. Call ejbCreate() 4. Returns primary key Client Code 3. Create database data 5. Create EJB object
  • 24.
  • 25.
  • 26. ejbRemove( )- II Destroying an entity bean’s data representation Home object EJB object Entity bean instance EJB Container/ Server 1. Call remove() 2. Call ejbRemove() Client Code 3. Remove database data 1. Call remove() 2. Call ejbRemove()
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.

Editor's Notes

  1. This slide is self explanatory. It states the three ways in which objects can be made persistent
  2. The slide is self explanatory. The state of the object is saved to permanent storage. This is done by object serialization. Here an object graph is marshaled into a compact representation . When the object graph is serialized, it is converted into a byte stream. The developer can then push data over the network or save the stream to a storage such as a file system, database or JNDI tree. However, object serialization has some drawbacks. For example, A file system stores a huge amount of serializable employee objects. This is done by converting the objects to their bit blob representation and then storing the bytes on disk. Suppose, employee information is needed for employees who have a salary above a particular amount. With serialisation each and every employee account serialized bit-blob from the disk, construct the corresponding object and then execute a method query on the object to determine if the salary is over that amount. Also, a number of advanced queries may also have to be done. This cannot be done with object serialisation. Querying objects using object serialization is very expensive and cumbersome. Submitting queries against business data is an absolute necessity for large-scale applications, which make simple object serialization has its purpose, it is best used in restricted domains, such as network communications and simple persistence.
  3. Here Java Objects are stored in traditional relational databases such as Oracle or Microsoft SQLServer. As evident in the slide each object is disintegrated into into its constituent parts. If you consider the previous example of the employee object, it can be decomposed into various parts. The employee number could be stored in one relational database row, name in another row and salary in another row. When you save these Java objects you will have to use JDBC or SQL/J to map the object data into a relational database.you could also store the name of the Java class that this data corresponds to, so that you know which class to instantiate when reading the object back from the database. When you want to load your objects from the database, you would first instantiate an object from that class, read the data in from the database and then populate that objects’s instance’s fields with the relational data read in. Object relational mapping as a persistence mechanism is a much more sophisticated mechanism of persisting objects than simple object serialisation. By disintegrating the Java objects as relational data you can issue arbitrary queries for information. For example, you can search through all the database records that have salary greater than the amount and load only objects that fulfill this query. More advanced queries are also possible. Mapping of objects to relational data can be done in two ways. You can either hand craft this mapping in your code or use an object-realtional mapping product such as ObjectPeople’s TOPLink or Sun’s JavaBlend to automate or facilitate this mapping. Today, most users hand-craft the mapping using a database access API such as JDBC or SQL/J. Because the cost of developing and maintaining an object relational mapping layer is significant, it is likely that the object relational mapping products will be adopted. Once a bean’s fields are mapped to the relational database, the container takes over the responsibility of keeping the state of an entity bean instance consistent with with corresponding tables in the database. This process is called synchronising the state of the bean instance.In the case of an EmployeeBean, bean insatnces at runtime will map one-to-one to rows in the Employee table of the relational database. When a change is mad e to the EmployeeBean, it is written to the appropriate row in the database. Frequently bean types will map to more than one table. These are more complicated mappings often requiring a SQL join. In addition to synchronizing the state of an entity, EJB provides mecahanisms for creating and removing entities. Calls to the EJB home to create and remove entities will result in a corresponding insertion or deletion of records in the database. Because entities store their state in a database tables, new records can be added from outside the EJB sytem. In other words, inserting a record into the Employee table or by direct access to the database – creates a new Employee entity . It is not created in the sense of instantiating a Java object, but in the sense that the data that describes an Employee entity has been added to the system. Object-to-relational persistence can become vety complex becauseobjects don’t always map cleanly to a relational database. Although you can specify any java serializable type as a container-managed field, Java objects don’t always map seamlessly to a relational database. You frequently need to convert Java types to some nonobject type just prior to synchronisation so that the data can be stored in a relational database. There are many other impedance mismatches when mapping object to realtinal databases, and then some EJB vendor implementations deal with them better than others. Relational databases however are still a very good persistence store because they are stable and well-understood. There is no shortage of developers who understood them or products that support them. In addition, the large number of SQL-standard relational databases makes it easy to migrate from one database to another.
  4. Object-oriented datbases are designed to preserve object types and object graphs and therefore are a much better match for components written in an object oriented language like Java. They offer a cleaner mapping between entity beans and the database than a relational database. Serilasable objects can be preserved without the mismatch associated with object-to-relational persistence because the object’s definition and state are simply stored as is to the database. Not only are the object’s definition and state saved to the database, complex relationships like circular references can also be maintained. Because object databases store objects, object databases are viewed by many developers as superior database technology for object persistence. While object databases perform well when it comes to very complex object graphs, they are still fairly new to business systems and are not as widely accepted as relational databases. As a result, they are not as standardized as relational databases making it more difficult to migrate from one database to another. In addition, fewer third-party products exist that support object databases, like products for reporting and data warehousing. Several relational databases support extended features for native object persistence. These databases allow some objects to be preserved in relational database tables like other data types and offer some advantages over other databases.
  5. The slide is self explanatory.
  6. Other examples could include bank account information and college records and so on. Need for persistent data components- why should you deal with business data as objects rather than dealing with raw database data, such as relational rows. The answer is that it is very handy to treat data as objects because they are represented in a compact manner. We can group related data together in a unified object. You associate some simple methods with that data, such as compression or other data related services. You can also gain implicit middleware services from an application server such as transactions, network accessibility and security.
  7. The slide is self explanatory.
  8. No bean is complete without its implementation class. This will reside on the server. When a client invokes a business method on the bean’s remote interface, that method invocation is received by the EJB object, which then delegates it to the bean. When developing any bean, you have to use the bean’s remote interface as a guide. Business methods defined in the remote interface
  9. The business methods of an enterprise bean are defined by a remote interface provided by the bean developer. The java.ejb.EJBObject interface, which extends the java.rmi.Remote interface is the base class for all remote interfaces. Remote interfaces are focused on the business problem and do not include methods for system level operations such as persistence, security, concurrency or transactions. System level operations are handled by the EJB server which relieves the client developer of many responsibilities. All remote interface methods for beans must throw at the very least, a java.rmi.RemoteException which identifies problems with distributed communications. In addition, methods in the remote interface can throw as many custom exceptions as needed to indicate abnormal business related conditions in executing the business method.
  10. The home interface of any entity bean is used to create, locate and remove objects from EJB systems. Each entity bean type has its own home interface. The home interface defines two basic kinds of methods-zero or more create methods and one or more find methods. The create methods act like remote constructors and define how new beans are created. In the Employee example, the find method is used to locate a specific example.
  11. Lets us say you have decided to author your own EJB container/server. Your product is responsible for instantiating entity beans as necessary, with each bean representing data in an underlying storage. As clients connect and disconnect, you could create and destroy data in an underlying storage. As clients connect and disconnect, you could create and destroy beans as necessary to service those clients. Unfortunately, this is not a scalable way to build an application server. Creation and destruction of objects is very expensive, especially if the client requests come frequently. How can we save this overhead? One thing to remember is that an entity bean class describes the fields and rules for your entity bean, but it does not dictate any specific data. For example, an entity bean class may specify that all employee accounts have the following data: Employee name Employee id Salary Department That bean class can then represent any distinct instance of database data such as a particular employee account record. The class itself, though is not specific to any particular employee account. Thus to save precious time instantiating objects, entity bean instances to represent different instances of the same type of data in an underlying storage. For example, a container could could use a employee account to represent different employee accounts. Thus when you are done with an entity bean instance, that instance may be assigned to handle a different client’s request and may be represent different data . The container performs this by dynamically assigning the entity bean instance to different client specific EJB-objects. Not only does this save the container from unnecessarily instantiating bean instances, but this scheme saves on the total amount of resources held by the system. Instance pooling is an interesting optimization that containers may provide and is not all unique to entity beans. Stateless session beans can also be recycled. But as with stateful session beans, there are complications when reassigning entity bean instances to different bean instances to different EJB objects. When your entity beans is assigned to a particular EJB object, it may be holding resources such as socket connections. But when it is in the pool, it may not need that socket. Thus to allow the bean to release and aquire resources, your entity bean class must implement two callback methods. ejbActivate() ejbPassivate()
  12. The slide is self explanatory. Additional Teaching It is sometimes handy to separate the kind of resources that the beans use into two categories:bean specific resources and bean-independent resources. Bean specific resources are resources that your bean uses that are tied to a specific data instance in an underlying storage. For example, a socket connection is a bean specific resource if that socket is used only when your bean instance is bound to a particular object. Such a resource should be acquired when a bean instance is activated and released when the instance is passivated. Bean-independent resources are resources that can be used over and over again no matter what underlying data your instance represents. For example, a socket connection
  13. An entity bean’s instance’s ejbCreate() method is used to initialise a bean for a particular client and to create underlying database data. Each ejbCreate() method you define gives clients a different way to create your beans. Here are some of the rules about ejbCreate(): You do not need to write any ejbCreate() methods with entity beans-Session beans require ejbCreate() methods, but they are optional for entities. You would define an ejbCreate() method if you want to providea way to create some underlying data through EJB. But remember that EJB does allow for you to create some underlying data indirectly, via direct database inserts or legacy systems. Thus ejbCreate() is optional. The parameters to ejbCreate() can vary. This allows for multiple ways to intialise an entity bean instance and thus allows for different ways to create entity bean instance and thus allows for different ways to create entity bean data in a database. For example, one ejbCreate() method might create a checking account,, while another might create a savings account. You must duplicate your ejbCreate() methods in your home interface.In EJB, remember that clients don’t directly invoke on beans-they invoke an EJB object proxy. The EJB object is generated through the home object. Therefore, for each ejbCreate() method signature you define in your bean, you must define a corresponding create() in the home interface. The client calls the home object’s create() which delegates to your bean’s interface. The client calls the home object’s create() which delegates to your beans’s ejbCreate().
  14. Example: Let us say you have a bean-managed persistent bank account entity bean class called AccountBean, with a remote interface account, home interface AccountHome and primary key class AccountPK. Given the following ejbCreate()method in Accountbean: public AccountPK ejbCreate(String accountID,String owner)… You must have this create() in your home interface. public Account create(String accountID, String owner) throws… Notice that there are two different return values here. The bean instance returns a primary key(AccountPK), while the home object returns an EJB object(Account). This makes sense-the bean returns a primary key to the container( that is, to the home object) so that the container can identify the bean. Once the home object has this primary key, it can create an EJB object and return that to the client.