SlideShare une entreprise Scribd logo
1  sur  25
ENTITY BEAN IN JAVA
                           Hiren Jamod
         Department Of ComputerScience
             Saurastra University-Rajkot
ENTITY BEANS
 Enterprise Beans which represent persistent
  data stored in a storage medium, such as a
  relational database.
 Persists across multiple sessions and can be
  accessed by multiple clients.
 Each instance of the entity bean represent a row
  in the table
 EJB container creates instances of an entity bean
  and is responsible for loading data in an instance
  and storing the information (data) back into the
  database.
ENTITY BEANS
   The persistent mechanisms that enable you to
    perform these database manipulations, such as
    serialization, Object/Relationship (O/R) mapping
    to a relational database and support for JDBC
    are built-in the entity bean model
CHARACTERISTICS
                         Persistence
   Implies that its state exists even after a client stops
    accessing an application
   The persistent data remain intact even after the
    storage shuts down
                       Shared Access
   Multiple clients can share one entity bean by using
    separate instances of the entity bean
   EJB Container maintains data consistency by
    synchronizing entity bean instances with the
    database
   To maintain data consistency, the entity beans work
    within a transaction
CHARACTERISTICS
                   Primary Key
 Each Entity bean has unique identifier; is known
  as Primary Key that enables the client to locate
  the exact entity bean
                   Relationships
 Like the data of a relational database, the entity
  beans are also elated to each other
LIFE CYCLE OF ENTITY BEANS
LIFE CYCLE OF ENTITY BEANS
 Initially, the beans do not exist
 When the Application server this stage to the Pooled
  stage
 When the server is first started, several bean
  instances are created and placed in the pool.
 A bean instance in the pooled state is not ties to

   particular data
 At this stage, the beans are referred as passivated.

 The bean remains in this stage till the client does

  not make a request for it or the container does not
  activate it.
LIFE CYCLE OF ENTITY BEANS
 The bean’s business methods can be invoked
  when the bean is at the ready stage.
 It remains at this stage till the client calls its
  remove method or the container passiveness it if
  the bean has been lying idle for sometimes
EJB SOURCE CODE
   Home Interface (extends EJBHome)
     Create - Find (for Entity)
     Factory Pattern
   Remote Interface (EJBObject)
     “Business Methods”
     Proxy Pattern
 Bean Class (EntityBean)
 Deployment descriptor (ejb-jar.xml)
CRAETE APPLICATION
GIVE NAME OF CRAETE APPLICATION
ADD SESSION BEAN
GIVE NAME OF SESSION BEAN
ADD PERSISTENCE UNIT
GIVE NAME PERSISTENCE UNIT
ADD ENTITY CLASS
ADD REFERENCE INTO WEB.XML
DECLER INTERFACE
DEFINE INTERFACE AND OVERRIDE
METHOD
DEFINE ENTITY BEANCLASS
DEFINE INDEX PAGE
DEFINE INDEX PAGE
DEFINE INDEX PAGE
DEFINE INDEX PAGE
SPECIAL THANKS T0 AMIT SIR
TO GIVE ME OPPORTUNITY TO REPRESENT MY
PRESENTATION.
                         BY HIREN JAMOD

Contenu connexe

Tendances (20)

Corba
CorbaCorba
Corba
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistence
 
Architecture of Mobile Computing
Architecture of Mobile ComputingArchitecture of Mobile Computing
Architecture of Mobile Computing
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types ppt
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
Java rmi
Java rmiJava rmi
Java rmi
 
Java beans
Java beansJava beans
Java beans
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJB
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
Distributed objects
Distributed objectsDistributed objects
Distributed objects
 
JNDI
JNDIJNDI
JNDI
 
JDBC Architecture and Drivers
JDBC Architecture and DriversJDBC Architecture and Drivers
JDBC Architecture and Drivers
 
Object modeling
Object modelingObject modeling
Object modeling
 
Query processing
Query processingQuery processing
Query processing
 
Xml processors
Xml processorsXml processors
Xml processors
 
Introduction to Web Services
Introduction to Web ServicesIntroduction to Web Services
Introduction to Web Services
 
Distributed database
Distributed databaseDistributed database
Distributed database
 
Enterprise java unit-2_chapter-3
Enterprise  java unit-2_chapter-3Enterprise  java unit-2_chapter-3
Enterprise java unit-2_chapter-3
 

En vedette

En vedette (8)

EJB .
EJB .EJB .
EJB .
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging Service
 
Tutorial su JMS (Java Message Service)
Tutorial su JMS (Java Message Service)Tutorial su JMS (Java Message Service)
Tutorial su JMS (Java Message Service)
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Java Mail
Java MailJava Mail
Java Mail
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebra
 
EJB Clients
EJB ClientsEJB Clients
EJB Clients
 

Similaire à Entity beans in java

Session 5 Tp5
Session 5 Tp5Session 5 Tp5
Session 5 Tp5phanleson
 
Ejb - september 2006
Ejb  - september 2006Ejb  - september 2006
Ejb - september 2006achraf_ing
 
EJB Interview Questions
EJB Interview QuestionsEJB Interview Questions
EJB Interview Questionsguest346cb1
 
Session 6 Tp6
Session 6 Tp6Session 6 Tp6
Session 6 Tp6phanleson
 
02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questionsDhiraj Champawat
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptrani marri
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEmprovise
 
TY.BSc.IT Java QB U5&6
TY.BSc.IT Java QB U5&6TY.BSc.IT Java QB U5&6
TY.BSc.IT Java QB U5&6Lokesh Singrol
 
Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3phanleson
 
EJB3 Advance Features
EJB3 Advance FeaturesEJB3 Advance Features
EJB3 Advance FeaturesEmprovise
 

Similaire à Entity beans in java (20)

Session 5 Tp5
Session 5 Tp5Session 5 Tp5
Session 5 Tp5
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
Ejb - september 2006
Ejb  - september 2006Ejb  - september 2006
Ejb - september 2006
 
EJB Interview Questions
EJB Interview QuestionsEJB Interview Questions
EJB Interview Questions
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
Session 6 Tp6
Session 6 Tp6Session 6 Tp6
Session 6 Tp6
 
Java bean
Java beanJava bean
Java bean
 
02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions
 
P20CSP105-AdvJavaProg.pptx
P20CSP105-AdvJavaProg.pptxP20CSP105-AdvJavaProg.pptx
P20CSP105-AdvJavaProg.pptx
 
J2 ee tutorial ejb
J2 ee tutorial ejbJ2 ee tutorial ejb
J2 ee tutorial ejb
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
 
Jsf+ejb 50
Jsf+ejb 50Jsf+ejb 50
Jsf+ejb 50
 
Introcution to EJB
Introcution to EJBIntrocution to EJB
Introcution to EJB
 
Ejb notes
Ejb notesEjb notes
Ejb notes
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business Logic
 
TY.BSc.IT Java QB U5&6
TY.BSc.IT Java QB U5&6TY.BSc.IT Java QB U5&6
TY.BSc.IT Java QB U5&6
 
TY.BSc.IT Java QB U5
TY.BSc.IT Java QB U5TY.BSc.IT Java QB U5
TY.BSc.IT Java QB U5
 
Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3
 
Ejb3 Presentation
Ejb3 PresentationEjb3 Presentation
Ejb3 Presentation
 
EJB3 Advance Features
EJB3 Advance FeaturesEJB3 Advance Features
EJB3 Advance Features
 

Dernier

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Dernier (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Entity beans in java

  • 1. ENTITY BEAN IN JAVA Hiren Jamod Department Of ComputerScience Saurastra University-Rajkot
  • 2. ENTITY BEANS  Enterprise Beans which represent persistent data stored in a storage medium, such as a relational database.  Persists across multiple sessions and can be accessed by multiple clients.  Each instance of the entity bean represent a row in the table  EJB container creates instances of an entity bean and is responsible for loading data in an instance and storing the information (data) back into the database.
  • 3. ENTITY BEANS  The persistent mechanisms that enable you to perform these database manipulations, such as serialization, Object/Relationship (O/R) mapping to a relational database and support for JDBC are built-in the entity bean model
  • 4. CHARACTERISTICS Persistence  Implies that its state exists even after a client stops accessing an application  The persistent data remain intact even after the storage shuts down Shared Access  Multiple clients can share one entity bean by using separate instances of the entity bean  EJB Container maintains data consistency by synchronizing entity bean instances with the database  To maintain data consistency, the entity beans work within a transaction
  • 5. CHARACTERISTICS Primary Key  Each Entity bean has unique identifier; is known as Primary Key that enables the client to locate the exact entity bean Relationships  Like the data of a relational database, the entity beans are also elated to each other
  • 6. LIFE CYCLE OF ENTITY BEANS
  • 7. LIFE CYCLE OF ENTITY BEANS  Initially, the beans do not exist  When the Application server this stage to the Pooled stage  When the server is first started, several bean instances are created and placed in the pool.  A bean instance in the pooled state is not ties to particular data  At this stage, the beans are referred as passivated.  The bean remains in this stage till the client does not make a request for it or the container does not activate it.
  • 8. LIFE CYCLE OF ENTITY BEANS  The bean’s business methods can be invoked when the bean is at the ready stage.  It remains at this stage till the client calls its remove method or the container passiveness it if the bean has been lying idle for sometimes
  • 9. EJB SOURCE CODE  Home Interface (extends EJBHome)  Create - Find (for Entity)  Factory Pattern  Remote Interface (EJBObject)  “Business Methods”  Proxy Pattern  Bean Class (EntityBean)  Deployment descriptor (ejb-jar.xml)
  • 11. GIVE NAME OF CRAETE APPLICATION
  • 13. GIVE NAME OF SESSION BEAN
  • 19. DEFINE INTERFACE AND OVERRIDE METHOD
  • 25. SPECIAL THANKS T0 AMIT SIR TO GIVE ME OPPORTUNITY TO REPRESENT MY PRESENTATION. BY HIREN JAMOD