Conversation
This commit implements Phase 3 of ESPI 4.0 schema compliance, updating IntervalReading to match the ESPI 4.0 XSD specification (espi.xsd:1016). Key Changes: IntervalReadingEntity: - Changed ID from UUID to Long (48+ bits) per Object pattern - IntervalReading extends Object, not IdentifiedObject - Reordered fields to match XSD sequence: cost → readingQualities → timePeriod → value → consumptionTier → tou → cpp - Updated @GeneratedValue to use IDENTITY strategy - Removed UUID-related imports IntervalReadingDto: - Removed currency field (not in ESPI 4.0 XSD) - Reordered record components to match XSD sequence - Updated @XmlType propOrder for correct XML marshalling - Updated all convenience constructors IntervalReadingMapper: - Simplified mappings (MapStruct handles by name) - Removed explicit field mappings - Kept only necessary ignore mappings (id, intervalBlock) Flyway Migrations: - Moved meter_readings, interval_blocks, and interval_readings tables from V3 to V2 vendor-specific files - Rationale: IntervalReading requires vendor-specific auto-increment syntax (BIGINT AUTO_INCREMENT for MySQL/H2, BIGSERIAL for PostgreSQL) - Updated V3 reading_qualities.interval_reading_id from CHAR(36) to BIGINT - Added clear documentation in V3 explaining table relocation Test Updates: - Fixed DtoExportServiceImplTest to use new constructor signature - All 550 tests passing including integration tests Migration Strategy: - V1: Base vendor-neutral tables - V2: Vendor-specific tables (now includes meter_readings, interval_blocks, interval_readings 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 was referenced Jan 8, 2026
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 3 of ESPI 4.0 schema compliance, updating IntervalReading to match the ESPI 4.0 XSD specification (espi.xsd:1016-1061).
Key Changes
IntervalReadingEntity:
Object, notIdentifiedObjectcost→readingQualities→timePeriod→value→consumptionTier→tou→cpp@GeneratedValueto useIDENTITYstrategyIntervalReadingDto:
currencyfield (not in ESPI 4.0 XSD)@XmlTypepropOrder for correct XML marshallingIntervalReadingMapper:
id,intervalBlock)Flyway Migrations:
meter_readings,interval_blocks, andinterval_readingstables from V3 to V2 vendor-specific filesBIGINT AUTO_INCREMENTBIGSERIALreading_qualities.interval_reading_idfromCHAR(36)toBIGINTto match new FK typeTest Updates:
DtoExportServiceImplTestto use new constructor signatureMigration Strategy
Test Plan
✅ All 550 unit and integration tests passing
Technical Details
XSD Reference: espi.xsd:1016-1061
Files Changed:
IntervalReadingEntity.java- Changed ID type, reordered fieldsIntervalReadingDto.java- Removed currency, reordered fieldsIntervalReadingMapper.java- Simplified mappingsV3__Create_additiional_Base_Tables.sql- Relocated tables, fixed FK typeV2__MySQL_Specific_Tables.sql- Added meter_readings, interval_blocks, interval_readingsV2__PostgreSQL_Specific_Tables.sql- Added meter_readings, interval_blocks, interval_readingsV2__H2_Specific_Tables.sql- Added meter_readings, interval_blocks, interval_readingsDtoExportServiceImplTest.java- Fixed test constructor callsRelated
🤖 Generated with Claude Code