You are previewing EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g.
O'Reilly logo
EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g

Book Description

This book walks you through the practical usage of EJB 3.0 database persistence with Oracle Fusion Middleware. Lots of examples and a step-by-step approach make it a great way for EJB application developers to acquire new skills.

  • Integrate EJB 3.0 database persistence with Oracle Fusion Middleware tools: WebLogic Server, JDeveloper, and Enterprise Pack for Eclipse

  • Automatically create EJB 3.0 entity beans from database tables

  • Learn to wrap entity beans with session beans and create EJB 3.0 relationships

  • Apply JSF and ADF Faces user interfaces (UIs) to EJB 3.0 database persistence

  • A practical guide illustrated with examples to integrate EJB 3.0 database persistence with Ajax and Web Services

  • In Detail

    EJB (Enterprise JavaBeans) 3.0 is a commonly used database persistence technology in Java EE applications. EJB 3.0 has simplified the development of EJBs with an annotations-based API that eliminates the use of remote/local interfaces, home/local home interfaces, and deployment descriptors. A number of other books are available on EJB 3.0, but none covers EJB 3.0 support in Oracle Fusion Middleware 11g, which is one of the leaders in the application server market.

    This is the first book that covers all aspects of EJB 3.0 database persistence development using Oracle Fusion Middleware technology. It covers all the best practices for database persistence ensuring that your applications are easily maintainable. Leaving theory behind, this book uses real-world examples to guide you in building your own EJB 3.0 applications that are well integrated with commonly used Java EE frameworks.

    The book gets going by discussing the new features in the EJB 3.0 specification. As some readers may still be using EJB 2.0, the book explains how to convert your EJB 2.0 entity beans to EJB 3.0. It then goes on to discuss using EJB 3.0 database persistence with JDeveloper, WebLogic Server, and Enterprise Pack for Eclipse, the main Java EE components of Oracle Fusion Middleware 11g. The book also covers EJB 3.0 relationships and integrating EJB 3.0 relationships with JSF user interfaces. EJB 3.0 database persistence with some of the commonly used frameworks such as ADF Faces, AJAX, and Web Services is also discussed in the book. It uses the integrated WebLogic Server 11g in some of the chapters and the standalone WebLogic Server in other chapters. While JDeveloper is the primary Java IDE used in the book, one of the chapters is based on the Oracle Enterprise Pack for Eclipse.

    By the time you reach the end of this book, you will be well-versed with developing EJB 3.0 applications using the different Java EE components of Oracle Fusion Middleware 11g.

    A practical guide illustrated with examples for developing EJB 3.0 applications integrated with commonly used Java EE frameworks such as JSF, Web Services, Ajax, and ADF Faces

    Table of Contents

    1. EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g
      1. EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g
      2. Credits
      3. About the Author
      4. About the Reviewers
      5. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Errata
          2. Piracy
          3. Questions
      6. 1. What's New in EJB 3.0
        1. Metadata annotations
        2. Configuration defaults
        3. Environmental dependencies and JNDI Access
        4. Simplified Session Beans
        5. Simplified entity beans
        6. Java Persistence API
        7. Interceptors
        8. Simplified checked exceptions
        9. Callback Interfaces
        10. Summary
      7. 2. Converting an EJB 2.0 Entity to an EJB 3.0 Entity
        1. Setting the environment
          1. Adding an Application
          2. Creating an XML deployment descriptor
          3. Creating stylesheets
        2. Converting the entity class
          1. The EJB 2.0 entity
          2. The XSLT stylesheet
          3. Generating the EJB 3.0 entity
        3. Developing a session façade for an entity
          1. The XSLT stylesheet
          2. Generating the session Façade
        4. Summary
      8. 3. EclipseLink JPA Persistence Provider
        1. Specifying the EclipseLink persistence provider
        2. The JPA framework
          1. Advantages of JPA
        3. What is required for JPA?
        4. Types of entity managers
          1. Container-managed entity manager
          2. Application-managed entity manager
        5. EclipseLink JPA
          1. Metadata annotations
          2. XML mapping metadata
          3. Entity identity
          4. Entity relationships
        6. EclispeLink JPA Persistence unit properties
        7. Summary
      9. 4. Building an EJB 3.0 Persistence Model with Oracle JDeveloper
        1. Setting the environment
        2. Creating a datasource in JDeveloper
        3. Creating an EJB 3 application
        4. Creating an EJB 3 entity bean
          1. Mapping an Oracle database table to an entity bean
          2. The entity bean class
        5. Creating a session bean
          1. The session bean class
        6. Creating and testing a test client
          1. Creating a client
          2. Testing the client
        7. Summary
      10. 5. EJB 3.0 Persistence with Oracle Enterprise Pack for Eclipse
        1. Setting the environment
          1. Installing required products
          2. Creating a MySQL database table
        2. Configuring WebLogic Server with MySQL database
          1. Creating a data source
          2. Deploying the data source
          3. Testing the data source
        3. Creating a JPA project in Eclipse
        4. Creating an EJB 3.0 entity bean
          1. The EJB 3.0 entity class
        5. Creating a Persistence Configuration file
        6. Creating a session bean
          1. The session bean class
        7. Creating a test client
        8. Deploying the entity in WebLogic Server
          1. Testing the EJB 3.0 entity client
        9. Summary
      11. 6. EJB 3.0 with ADF Faces UI
        1. Setting the environment
          1. Creating a datasource in JDeveloper
          2. Creating an EJB 3 application
        2. Creating an EJB 3 entity bean from Oracle database
          1. The Entity class
          2. The persistence configuration file
        3. Creating a session bean
          1. The session bean class
        4. Creating an Oracle ADF Faces client user interface
          1. Creating a JSF page
          2. Adding ADF Faces components
            1. The index JSF page
            2. The JSF page to create an Entity
            3. The JSF page to find an Entity
            4. The catalog entry JSF page
            5. The managed bean
          3. The JSF configuration file
          4. The web application configuration file
        5. Testing the Oracle ADF Faces user interface
          1. Creating an Entity instance
          2. Finding an Entity instance
        6. Summary
      12. 7. Creating EJB 3.0 Entity Relationships
        1. EJB 3.0 entity relationship annotations
        2. Setting the environment
          1. Creating database tables
          2. Creating an EJB project
        3. Creating the entity beans
          1. The Entity classes
            1. The Catalog entity class
            2. The Edition entity class
            3. The Section entity class
            4. The Article entity class
        4. Creating a session bean
          1. The Session Bean class
        5. Creating the client
        6. Testing the client
        7. Modifying the fetch strategy
        8. Summary
      13. 8. EJB 3.0 Database Persistence with Ajax in the UI
        1. The XMLHttpRequest Object
        2. Setting the environment
          1. Installing WebLogic Server
        3. Creating an EJB 3.0 application in JDeveloper
          1. Creating a database connection
            1. Creating a data source in WebLogic Server
        4. Creating an entity bean
          1. The entity bean class
          2. The Entity configuration file
        5. Creating a session bean
          1. The session bean class
        6. Creating a servlet client
          1. The Servlet class
        7. Creating an Ajax user interface
          1. Sending an Ajax request
          2. Processing the server response
          3. The Ajax user interface JSP
          4. Creating an application deployment descriptor
        8. Deploying the EJB 3 application to WebLogic Server
          1. Creating a build file
          2. Deploying the EJB 3.0 application
        9. Testing the Ajax input form
        10. Summary
      14. 9. Using JSF with Entity Relationships
        1. Setting the environment
          1. Creating database tables
          2. Creating an EJB 3.0 application
          3. Creating a database connection
        2. Creating entity beans from tables
          1. Edition entity
          2. Section entity
          3. Article entity
          4. Entity Persistence Configuration file
        3. Creating a session bean
          1. Session bean class
        4. Creating JSF user interfaces
          1. Adding JSF components to the article JSF page
            1. Managed bean for the article JSF page
          2. Adding JSF components to the section JSF page
            1. Managed bean for the section JSF page
          3. Adding JSF components to the Edition JSF page
            1. Managed bean for the Edition JSF page
          4. Adding JSF page navigation
          5. Web configuration file
        5. Running the JSF user interfaces
          1. Creating an Edition entity
          2. Creating a Section entity
          3. Creating an Article entity
          4. The database persisted entities
        6. Summary
      15. 10. Creating an EJB 3.0 Web Service
        1. Setting the environment
          1. Creating a JDeveloper application
          2. Creating a database connection
        2. Creating a data source in the WebLogic server
        3. Creating an entity bean
          1. The Entity class
          2. The entity Persistence Configuration file
        4. Creating a stateless session bean
          1. The session bean class
        5. Creating a Web Service class
        6. Creating a web service client
        7. Creating and packaging Web Service classes
        8. Testing the web service
          1. Building the client
          2. Testing the client
        9. Summary