Skip to content

Chapter JPA outline

Aslak Knutsen edited this page Apr 14, 2013 · 2 revisions

Use Case / Requirements

  • Data storage backend

  • Requirement Statements

As a User I should be able to Add/Change/Delete a Conference

As a User I should be able to Add/Change/Delete a Session
  to Conferences

As a User I should be able to Add/Change/Delete a Attachment
 to Sessions and Conferences

As a User I should be able to Add/Change/Delete a Venue
  (and attch to Conference and Session)
  • Domain model

    • Conference

      • Session

    • User

    • Attchment

    • Venue

      • Room

Background

  • Java Persistence

    • What is JPA

    • How does JPA work

    • How do we map data

    • What is the EntityManager

      • Concept

      • Usage

    • What is the Provider

      • Hibernate / EclipseLink / OpenJPA

      • How do we configure the Provider

        • persistence.xml

Implementation

  • JPA, EJB, Transactional

    • JPA Entities stored in a EntityManager behind a Transactional EJB

Requirement Test Scenarios

Overview

  • Store data

  • Retrieve data

  • Delete data

  • Transaction handling

    • Commit

    • Rollback

    • Advanced coverage from Test Perspective in Chapter 06

Setup

  • Arquillian Persistence Extension

    • CED/pom.xml dependencyManagement arquillian-persistence-impl

    • CED/CED/pom.xml dependency arquillian-persistence-impl

    • persistence.xml / datasource scanned by APE

    • arquillian.xml extension persistence

Domain Conference

Store

As a User I should be able to add a Conference
As a User I should be able to add a Session
  • Setup dataset

  • Setup expected output

  • Create Conference Domain Model

  • Create Conference Repository 'create'

Update

As a User I should be able to change a Conference
As a User I should be able to change a Session
  • Setup dataset

  • Setup expected output

  • Create Conference Repository 'update'

Remove

As a User I should be able to remove a Conference
As a User I should be able to remove a Session
  • Setup dataset

  • Setup expected output

  • Create Conference Repository 'delete'

Domain User

  • Not explained, only code

  • See Conference

Domain Venue

  • Not explained, only code.

  • See Conference

Domain Attachment

  • Not explained, only code.

  • See Conference