How spring-projects/spring-data-relational works
Main Components
a. Core Components:
• Relational Core (spring-data-relational)
• JDBC Support (spring-data-jdbc)
• R2DBC Support (spring-data-r2dbc)
b. Infrastructure Layer:
• Repository Infrastructure
• Mapping Infrastructure
• Query Infrastructure
• Dialect Support
Component Relationships
[Application Layer]
• ↓
[Repository Layer]
• ↙ ↘
[JDBC] [R2DBC]
• ↘ ↙
[Relational Core]
• ↓
[Database Layer]
Detailed Component Breakdown
a. Repository Layer:
• CrudRepository/ReactiveCrudRepository interfaces
• Custom query methods
• Query execution infrastructure
• Event publishing system
b. JDBC Implementation:
• JdbcAggregateTemplate
• JdbcConverter
• SQL generation
• MyBatis integration
c. R2DBC Implementation:
• R2dbcEntityTemplate
• R2dbcConverter
• Reactive operations
• Connection handling
d. Relational Core:
• Mapping context
• Dialect support
• SQL rendering
• Event system
Features
Important features:
• CRUD operations
• Query methods
• Auditing support
• Event handling
• Custom conversions
• Dialect support
• Transaction management
Connection Points
Integration points with:
• Spring Framework
• Database drivers
• MyBatis (for JDBC)
• Application code
• Testing infrastructure
Data Flow
Flow for both synchronous (JDBC) and reactive (R2DBC) operations:
[Application] → [Repository] → [Template] → [Converter] → [SQL Generation] → [Database]
Cross-Cutting Concerns
Aspects:
• Configuration support
• Auditing
• Event handling
• Transaction management
• Type conversion
Remember to emphasize:
• The separation between JDBC and R2DBC implementations
• The shared relational core infrastructure
• The repository abstraction layer
• The different database dialect support
• The event system architecture
• The mapping infrastructure