Spring Persistence: A Running Start

Book description

Published with the developer in mind, firstPress technical briefs explore emerging technologies that have the potential to be critical for tomorrow's industry. Apress keeps developers one step ahead by presenting key information as early as possible in a PDF of 150 pages or less. Explore the future through Apress with Spring Persistence—A Running Start.

This firstPress title gets readers rolling with the various fundamental Spring Framework Java Persistence concepts and offerings, as well as proven design patterns for integrating Spring Persistence functionality for complex and transaction–based enterprise Java applications.

The Java platform offers several options for saving "long—lived" information, including JPA (Java Persistence API), Hibernate, iBatis, JDBC, and even JCR (Java Content Repository—a standard for interfacing with a content management system).

This book helps readers decide which persistence solution is the most ideal for their application requirements, and shows how Spring can be leveraged to simplify the integration of their selected persistence framework into their enterprise application.

Table of contents

  1. Cover Page
  2. Title Page
  3. Contents
  4. About the Authors
  5. Acknowledgements
  6. Chapter 1: Introducing Spring Persistence
    1. Persistence
    2. Spring as a de Facto Standard
      1. Spring and JavaBeans
      2. Inversion of Control and Dependency Injection
    3. Exploring Spring Design Patterns and Strategies
      1. The Spring Life Cycle
      2. An Overview of Handy Spring Interfaces
    4. Injecting Code Using AOP and Interceptors
      1. Code Weaving to Inject Functionality
      2. Using Declarative Transactions
    5. Application Layering
      1. The Domain Model Layer
      2. The DAO Layer
      3. The Service Layer
    6. Understanding Your Persistence Options
    7. Summary
  7. Chapter 2: Using Spring JDBC
    1. Integrating JDBC into Your Application Using Spring
    2. Integrating Datasources with Spring JDBC
    3. Creating an ApplicationContext
    4. Using Singleton Beans
    5. Integrating a Database
    6. Adding Persistence
      1. Using the Template Pattern for Persistence
      2. Working with the Spring JDBCTemplate
      3. Using RowMapper
      4. Implementing Our DAO Interface
    7. Using the SimpleJdbc Classes
    8. Updating and Executing via JdbcTemplate
      1. Handling Binary Data
    9. Other JdbcTemplate Implementatons
    10. Summary
  8. Chapter 3: Using Spring with Hibernate
    1. Migrating Our Gallery Application to Hibernate
      1. Defining the Associations
    2. Building the Comment and ArtEntity Java Classes
      1. Exploring the Annotations
      2. Using Cascading Options to Establish Data Relationships
      3. Lazy Loading with Hibernate
    3. Rounding Out the Domain Model
      1. Using Polymorphism with Hibernate
      2. Adding the ArtData Base Class
    4. Building the DAOs
      1. Building the Hibernate DAO Layer Using Spring
      2. Enabling Query Caching with the HibernateTemplate
      3. Creating Our Category DAO Implementation
      4. Using HQL Queries
    5. Persisting Data with Hibernate
      1. Using import Statements
      2. Managing Transactions
      3. Defining the Service Facade Layer
    6. Summary
  9. Chapter 4: Integrating JPA with Spring
    1. Considering Configuration Options
    2. Creating Your First JPA Application
      1. @Entity
      2. Using EntityManager in CRUD Operations
      3. Configuring JPA and Spring
    3. Unit Testing JPA and Spring
    4. Summary
  10. Chapter 5: Introducing the iBATIS Data Mapper
    1. Getting to Know iBATIS
    2. Getting Started with iBATIS
      1. Setting Up the SQL Map File
      2. Writing the DAO
      3. Configuring Spring
      4. Configuring SQL Map
    3. Moving Beyond the Basics
      1. Mapping Results
      2. Using Dynamic SQL
      3. Caching
      4. Managing Transactions
    4. Summary
  11. Chapter 6: Managing Transactions
    1. The Joy of ACID
      1. Controlling the ACID Problem
      2. Platform Transaction Management
      3. Declarative Transaction Management
      4. Using @Transactional for ACID Transactional Annotations
      5. XML-Driven Transaction Configuration
    2. Examining Transactional Examples
      1. Creating a Batch Application
      2. Using Two Datasources
    3. Summary
  12. Chapter 7: Integration Testing with JUnit
    1. Integration Testing
    2. Using JUnit 4.4 and Annotations to Facilitate Testing
    3. Spring JUnit 4 Extensions
    4. Testing with a Database
    5. Summary
  13. Chapter 8: Using Spring with a Content Management System
    1. Introducing JCR
    2. Introducing Spring Modules
    3. Architecting Your Repository
      1. Defining the JCR Data Model
      2. Getting Started with JCR
    4. Querying for JCR Nodes
    5. Defining Our Service Layer
    6. Summary
  14. Chapter 9: Rapid Web Development Using Groovy and Grails
    1. Getting Grails Running
      1. Exploring the Grails Application Directory Structure
      2. Booting Up
      3. Configuring Your Application
      4. Configuring Your Datasource
      5. Mapping URLs
    2. Exploring the Grails Application Layers
      1. Defining Your Domain Model
      2. Defining Constraints and Validation
      3. Customizing Domain Class Hibernate Mappings
    3. Using Active Record as an Alternative to the DAO
    4. Understanding the Active Record Pattern
      1. Looking Under the Hood of GORM
    5. Getting to Know Groovy
      1. Letting Your Types Loose
      2. Using GStrings: Strings on Steroids
    6. Using Default Constructors in Groovy
      1. Using Closures in Groovy
      2. Working with Dynamic Finder Methods
      3. Creating Advanced Query Methods
      4. Using the Criteria API
      5. Handling Associations in Grails
      6. Scaffolding Your Grails Application
      7. Building and Running Your Application
    7. Defining a Transactional Service Layer in Grails
      1. Generating a Service Class
    8. Summary
  15. Related Titles
  16. Copyright

Product information

  • Title: Spring Persistence: A Running Start
  • Author(s): Paul Tepper Fisher, Solomon Duskis
  • Release date: February 2009
  • Publisher(s): Apress
  • ISBN: 9781430218777