feat: ESPI 4.0 Schema Compliance - Phase 4: ReadingQuality#69
Merged
Merged
Conversation
This commit implements Phase 4 of ESPI 4.0 schema compliance, updating ReadingQuality to match the ESPI 4.0 XSD specification (espi.xsd:1062). Key Changes: ReadingQualityEntity: - Changed ID from UUID to Long (48+ bits) per Object pattern - ReadingQuality extends Object, not IdentifiedObject - Updated @GeneratedValue to use IDENTITY strategy - Removed UUID-related imports (JdbcTypeCode, SqlTypes) - Field order already correct (only has quality field per XSD) ReadingQualityDto: - Already compliant - no changes needed - Single quality field matches XSD specification ReadingQualityMapper: - Simplified mappings (MapStruct handles by name) - Removed explicit quality field mapping - Kept only necessary ignore mappings (id, intervalReading) Flyway Migrations: - Moved reading_qualities table from V3 to V2 vendor-specific files - Rationale: ReadingQuality requires vendor-specific auto-increment syntax (BIGINT AUTO_INCREMENT for MySQL/H2, BIGSERIAL for PostgreSQL) - Removed all IdentifiedObject fields (description, created, updated, published, links) from table structure - Updated V3 header to document reading_qualities relocation - Added to dependency chain: meter_readings → interval_blocks → interval_readings → reading_qualities Test Results: - All 550 tests passing including integration tests - PostgreSQL TestContainer integration tests: ✅ - MySQL TestContainer integration tests: ✅ - H2 in-memory integration tests: ✅ Migration Strategy: - V1: Base vendor-neutral tables - V2: Vendor-specific tables (now includes meter_readings, interval_blocks, interval_readings, reading_qualities with correct auto-increment syntax) - V3: Additional tables that depend on V1 and V2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements Phase 4 of ESPI 4.0 schema compliance, updating ReadingQuality to match the ESPI 4.0 XSD specification (espi.xsd:1062-1077).
Key Changes
ReadingQualityEntity:
Object, notIdentifiedObject@GeneratedValueto useIDENTITYstrategyqualityfield per XSD)ReadingQualityDto:
qualityfield matches XSD specificationReadingQualityMapper:
qualityfield mappingid,intervalReading)Flyway Migrations:
reading_qualitiestable from V3 to V2 vendor-specific filesBIGINT AUTO_INCREMENTBIGSERIALTest Plan
✅ All 550 unit and integration tests passing
Technical Details
XSD Reference: espi.xsd:1062-1077
Files Changed:
ReadingQualityEntity.java- Changed ID type to LongReadingQualityMapper.java- Simplified mappingsV3__Create_additiional_Base_Tables.sql- Relocated table, updated headerV2__MySQL_Specific_Tables.sql- Added reading_qualitiesV2__PostgreSQL_Specific_Tables.sql- Added reading_qualitiesV2__H2_Specific_Tables.sql- Added reading_qualitiesMigration Strategy
Related
🤖 Generated with Claude Code