feat: Phase 1 - TimeConfiguration ESPI 4.0 schema compliance with JAXB#51
Merged
Conversation
Implements Phase 1 of 26-phase NAESB ESPI 4.0 schema compliance plan using JAXB (Jakarta XML Binding) for XML marshalling/unmarshalling on Spring Boot 4.0.1 and Java 25. ## Implementation **DTO Layer (JAXB):** - TimeConfigurationDto: JAXB DTO with @XmlRootElement and XSD propOrder compliance - Byte array cloning for DST rules (defensive copying) - Utility methods: getTzOffsetInHours(), getEffectiveOffset(), hasDstRules() - All 11 XML marshalling/unmarshalling tests passing **Mapper Layer:** - TimeConfigurationMapper: MapStruct bidirectional Entity-DTO conversion - UUID handling: Entity.id → DTO.uuid mapping - Ignores transient and managed fields **Repository:** - Removed 3 XPath-based query methods (non-index queries) - Retained 2 index-based query methods: findAllIds(), findAllIdsByUsagePointId() **Database Migration:** - V4__Create_Time_Configurations.sql: XSD propOrder column sequence - Indexes on created, updated, tz_offset ## Code Quality (SonarQube Fixes) **TimeConfigurationDtoTest:** - Replaced generic "throws Exception" with specific "throws JAXBException" (3 methods) - Fixed variable naming to match camelCase convention (utcMinusEight, utcPlusFivePointFive) - Methods that call marshaller/unmarshaller now declare JAXBException **TimeConfigurationRepositoryTest:** - Chained assertions for better readability (3 locations) - Removed unused variables (2 occurrences) - Used hasSameHashCodeAs() for hashCode assertion **SonarQube Configuration:** - Created sonar-project.properties to exclude Oracle-specific SQL rules - Project uses MySQL, PostgreSQL, H2 - VARCHAR2 rule doesn't apply - Configured multicriteria exclusions for sql:S6397 and sql:Oracle* rules ## Testing - ✅ All 11 TimeConfigurationDtoTest tests pass (Spring Boot 4.0 + Java 25) - ✅ XML marshalling/unmarshalling validated - ✅ JAXB functionality verified with realistic timezone data - ✅ Round-trip marshalling integrity confirmed ## Documentation **Analysis Documents:** - DTO_APPROACH_COMPARISON.md: JAXB vs Jackson XML evaluation - PR50_MULTI_PHASE_IMPACT.md: Spring Boot 4.0 upgrade impact on all 26 phases - PR50_TEST_FAILURE_FIX.md: Timestamp precision test fix - JUNIE_VS_CLAUDE_GUIDELINES_COMPARISON.md: Test pattern migration guide **Plan Updates:** - MULTI_PHASE_SCHEMA_COMPLIANCE_PLAN.md: Updated with Spring Boot 4.0 stack - Added comprehensive Spring Boot 4.0 test patterns for remaining 25 phases ## Technology Stack - Java 25 (LTS - Zulu 25.28+85-CA) - Spring Boot 4.0.1 - Jakarta EE 11 - JAXB (jakarta.xml.bind-api 4.x) - MapStruct 1.6.3 Team Decision: JAXB selected for all 26 phases due to Jackson 3.0 XML immaturity in Spring Boot 4.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The time_configurations table was already created in V2__MySQL_Specific_Tables.sql because it contains BLOB columns requiring vendor-specific handling. The V4 migration was attempting to create the same table, causing CI/CD failures with error: SQL State: 42S01 Error Code: 1050 Message: Table 'time_configurations' already exists Changes: - Deleted openespi-common/src/main/resources/db/migration/V4__Create_Time_Configurations.sql - Fixed openespi-thirdparty/pom.xml artifactId capitalization for consistency Related to #51 (Phase 1: TimeConfiguration DTO implementation) 🤖 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
Implements Phase 1 of 26 in the NAESB ESPI 4.0 schema compliance plan. This phase establishes TimeConfiguration DTO with JAXB XML marshalling/unmarshalling on Spring Boot 4.0.1 + Java 25.
Implementation Details
DTO Layer (JAXB)
TimeConfigurationDtowith@XmlRootElementand XSD propOrder compliancegetTzOffsetInHours(),getEffectiveOffset(),hasDstRules()Mapper Layer
TimeConfigurationMapperusing MapStruct 1.6.3Entity.id→DTO.uuidRepository
findAllIds(),findAllIdsByUsagePointId()Database Migration
V4__Create_Time_Configurations.sqlwith XSD propOrder column sequencecreated,updated,tz_offsetCode Quality
SonarQube Fixes
throws Exceptionwith specificthrows JAXBExceptionutcMinusEight,utcPlusFivePointFive)hasSameHashCodeAs()for hashCode assertionsSonarQube Configuration
sonar-project.propertiesto exclude Oracle-specific SQL rulessql:S6397,sql:Oracle*Testing
Test Results
Test Environment
Documentation
Analysis Documents
DTO_APPROACH_COMPARISON.md- JAXB vs Jackson XML evaluationPR50_MULTI_PHASE_IMPACT.md- Spring Boot 4.0 impact on all 26 phasesPR50_TEST_FAILURE_FIX.md- Timestamp precision test fixJUNIE_VS_CLAUDE_GUIDELINES_COMPARISON.md- Test pattern migration guidePlan Updates
MULTI_PHASE_SCHEMA_COMPLIANCE_PLAN.mdupdated with Spring Boot 4.0 stackTeam Decisions
JAXB selected for all 26 phases
Test Plan
Next Steps
After this PR merges:
🤖 Generated with Claude Code