Description
Verify that all entities extending IdentifiedObject have field data types and lengths that match the definitions in the ESPI 4.0 XSD schema files (espi.xsd and customer.xsd).
Background
The OpenESPI-GreenButton-Java implementation has been migrated to Spring Boot 4.0 and Jakarta EE 10+, with entities using Jakarta Persistence annotations. We need to ensure that all JPA entity field definitions remain compliant with the NAESB ESPI 4.0 specification.
Entities to Verify
Usage Domain (espi.xsd)
Located in openespi-common/src/main/java/org/greenbuttonalliance/espi/common/domain/usage/:
- UsagePointEntity - Metering point
- MeterReadingEntity - Meter reading collection
- IntervalBlockEntity - Time-series interval data
- ReadingTypeEntity - Measurement metadata
- ElectricPowerQualitySummaryEntity - Power quality metrics
- UsageSummaryEntity - Usage aggregation
- LocalTimeParametersEntity - Timezone configuration
- RetailCustomerEntity - Customer information
- ApplicationInformationEntity - OAuth2 application registration
Customer Domain (customer.xsd)
Located in openespi-common/src/main/java/org/greenbuttonalliance/espi/common/domain/customer/entity/:
- CustomerAccountEntity - Customer billing account
- CustomerEntity - Customer information
- CustomerAgreementEntity - Service agreement
- ServiceSupplierEntity - Utility provider
- MeterEntity - Physical meter device
- EndDeviceEntity - End device information
- ServiceLocationEntity - Service delivery location
- StatementEntity - Billing statement
- ProgramDateIdMappingsEntity - Program date mappings
XSD Schema References
- espi.xsd:
openespi-common/src/main/resources/schema/ESPI_4.0/espi.xsd
- customer.xsd:
openespi-common/src/main/resources/schema/ESPI_4.0/customer.xsd
Verification Requirements
For each entity, verify:
-
Field Data Types: JPA @Column types match XSD element types
- String fields have appropriate
length attribute
- Numeric fields use correct Java types (Integer, Long, BigInteger, BigDecimal)
- Date/time fields use appropriate temporal types
- Enum fields map to XSD enumeration types correctly
-
Field Length Constraints: String field @Column(length=...) matches XSD maxLength facets
-
Nullable Constraints: @Column(nullable=...) matches XSD minOccurs requirements
-
Embedded Objects: @Embedded objects match XSD complex type definitions
-
Collections: @ElementCollection and @OneToMany mappings match XSD sequence/choice definitions
Acceptance Criteria
Example Verification Pattern
For UsagePointEntity:
// Entity field
@Column(name = "service_category_kind")
private ServiceKind serviceCategory;
// XSD definition (espi.xsd)
<xs:element name="ServiceCategory" type="espi:ServiceKind" minOccurs="1"/>
// Verification:
// ✓ Type matches (ServiceKind enum)
// ✓ Nullable constraint matches (minOccurs=1 → nullable=false expected)
Related Issues
Priority
Medium - This is a technical debt/compliance verification task that ensures long-term schema compliance and interoperability.
Description
Verify that all entities extending
IdentifiedObjecthave field data types and lengths that match the definitions in the ESPI 4.0 XSD schema files (espi.xsdandcustomer.xsd).Background
The OpenESPI-GreenButton-Java implementation has been migrated to Spring Boot 4.0 and Jakarta EE 10+, with entities using Jakarta Persistence annotations. We need to ensure that all JPA entity field definitions remain compliant with the NAESB ESPI 4.0 specification.
Entities to Verify
Usage Domain (espi.xsd)
Located in
openespi-common/src/main/java/org/greenbuttonalliance/espi/common/domain/usage/:Customer Domain (customer.xsd)
Located in
openespi-common/src/main/java/org/greenbuttonalliance/espi/common/domain/customer/entity/:XSD Schema References
openespi-common/src/main/resources/schema/ESPI_4.0/espi.xsdopenespi-common/src/main/resources/schema/ESPI_4.0/customer.xsdVerification Requirements
For each entity, verify:
Field Data Types: JPA
@Columntypes match XSD element typeslengthattributeField Length Constraints: String field
@Column(length=...)matches XSDmaxLengthfacetsNullable Constraints:
@Column(nullable=...)matches XSDminOccursrequirementsEmbedded Objects:
@Embeddedobjects match XSD complex type definitionsCollections:
@ElementCollectionand@OneToManymappings match XSD sequence/choice definitionsAcceptance Criteria
Example Verification Pattern
For
UsagePointEntity:Related Issues
Priority
Medium - This is a technical debt/compliance verification task that ensures long-term schema compliance and interoperability.