本文为学习官方文档的学习笔记,单纯知识点摘要。官方文档: https://docs.spring.io/spring/docs/current/spring-framework-reference/data-access.html#spring-data-tier

1) Transaction Management

  • Advantages of the Spring Framework's Transaction Support Model
    • Global Transactions
    • Local Transactions
    • Spring Frameworks's Consistent programming Model
  • Understanding the Spring Framework Transaction Abstraction
  • Synchronizing Resources with Transactions
    • High-level Synchronization Approach
    • Low-level Synchronization Approach
    • TransactionAwareDataSourceProxy
  • Declarative transaction management
    • Understanding the Spring Framework's Declarative Transaction Implementation
    • Example of Declarative Transaction Implementation
    • Rolling Back a Declarative Transaction
    • Configuring Different Transactional Semantics for Different Beans
    • <tx:advice/> Settings
    • Using @Transactional 
      • @Transactional Settings 
      • Multiple Transaction Managers with @Transacitonal
      • Custom Shortcut Annotations
    • Transaction Propagation
      • Understanding PROPAGATION_REQUIRED
      • Understanding PROPAGATION_REQUIRES
      • Understanding PROPAGATION_NESTED
    • Advising Transactional Operations
    • Using @Transactional with AspectJ
  • Programmatic Transaction Management
    • Using the TransactionTemplate
      • Specifying Transaction Settings
      •  
    • Using the PlatformTransactionManager
  • Choosing Between Programmatic and Declarative Transaction Management 
  • Transaction-bound Events
  • Application server-specific integration
    • IBM WebSphere
    • Oracle WebLogic Server
  • Solutions to Common Problems
    • Using the Wrong Transaction Manager for a Specific DataSource
  • Further Resource

 

2)DAO Support

  • Consistent Exception Hierarchy
  • Annotations Used to Configure DAO or Repository Classes

 

3)Data Access with JDBC

  • Choosing an Approach for JDBC Database Access
  • Package Hierarchy
  • Using the JDBC Core Classes to Control Basic JDBC Processing and Error Handling
    • Using JdbcTemplate
      • Querying(SELECT)
      • Updating (INSERT, UPDATE, and DELETE) with JdbcTemplate
      • Other JdbcTemplate Operations 
      • JdbcTemplate Best Practices
    • Using NamedParameterJdbcTemplate
    • Using SQLExceptionTranslator
    • Running Statements
    • Running Queries
    • Updating the Database
    • Retrieving Auto-generated Keys
  • Controlling Database Connections
    • Using DataSource
    • Using DataSourceUtils
    • Implementing SmartDataSource
    • Extending AbstractDataSource
    • Using SingleConncetionDataSource
    • Using DrivermangerDatSource
    • Using TransactionAwareDataSource
    • Using DataSourceTransactionManager
  • JDBC Batch Operations
    • Basic Batch Operations with JdbcTemplate
    • Batch Operations with a List of Objects
    • Batch Operations with Multiple Batches
  • Simplifying JDBC Operations with the SimpleJdbc Classes
    • Inserting Data by Using SimpleJdbcInsert
    • Retrieving Auto-generated Keys using SimpleJdbcInsert
    • Specifying Columns for a SimpleJdbcInsert
    • Using SqlParameterSource to Provide Parameter Values
    • Calling a Stored Procedure with SimpleJdbcCall
    • Explicitly Declaring Parameters to Use for a SimpleJdbcCall
    • How to Define SqlParameters
    • Calling a Stored Function by using SimpleJdbcCall
    • Returning a ResultSet or REF Cursor from a SimpleJdbcCall
  • Modeling JDBC Operations as Java Objects
    • Understanding SqlQuery
    • Using MappingSqlQuery
    • Using SqlUpdate
    • Using StoredProcedure
  • Common Problems with Parameter and Data Value Handling
    • Providing SQL Type Information for Parameters
    • Handling BLOB and CLOB objects
    • Passing in Lists of Values for IN clause
    • Handling Complex Types for Stored Procedure Calls
  • Embedded Database Support
    • Why Use an Embedded Database
    • Creating an Embedded Database by using Spring XML
    • Creating an Embedded Database Programmatically
    • Selecting the Embedded Database Type
      • Using HSQL
      • Using H2
      • Using Derby
    • Testing Data Access Logic with an Embedded Database
    • Generating Unique names for Embedded Databases
    • Extending the Embedded Database Support
  • Initializing a DataSource
    • Initializing a Database by Using Spring XML
      • Initialization of Other Components that Depend on the database

 

4)Object Relational Mapping(ORM) Data Access

  • Introduction to ORM with Spring
  • General ORM Integration Considerations
    • Resource and Transaction Management
    • Exception Translation
  • Hibernate
    • SessionFactory Setup in a Spring Container
    • Implementing DAOs based on the plain Hibernate API
    • Declarative Transaction Demarcation
    • Programmatic Transaction Demarcation
    • Comparing Container-managed and Locally Defined Resources
    • Spurious Application Server Warnings with Hibernate
  • JPA
    • Three Options for JPA Setup in a Spring Environment
      • Using LocalEntityManagerFactory
      • Obtaining an EntityManagerFactory from JNDI
      • Using LocalContainerEntitymanagerFactory
      • Dealing with Multiple Persistence Units
      • Background Bootstrapping
    • Implementing DAOs based on JPA: EntityMangerFactory and EntityManger
    • Spring-driven JPA transactions
    • Understanding JpaDialect and JpaVendorAdapter
    • Setting up JPA with JTA Transaction Management
    • Native Hibernate Setup and Native Hibernate Transactions for JPA Interaction

5) Marshalling XML by Using Object-XML Mappers

  • Introduction
    • Ease of configuration 
    • Consistent Interfaces
    • Consistent Exception Hierarchy
  • Marshaller and Unmarshaller
    • Understanding Marshaller
    • Understanding Unmarshaller
    • Understanding XmlMappingException
  • Using Marshaller and Unmarshaller
  • XML Configuration Namespace
  • JAXB
    • Using Jaxb2Marshaller
      • XML Configuration Namespace
  • Castor
    • Using CastorMarshaller
    • Mapping
      • XML Configuration Namespace
  • JiBX
    • Using JibxMarshaller
      • XML Configuration Namespace
  • XStream
    • Using XStreamMarshaller

 

6) Appendix

  • XML Schemas
    • The tx Schema
    • The jdbc Schema

 

发表评论