package com.ankurm.sdjpa4demo.domain; import jakarta.persistence.Embeddable; import java.math.BigDecimal; // A value object: no identity, just its two values. Records make ideal @Embeddable // types in Spring Data JPA 4 / Hibernate 7 - immutable, and equals()/hashCode() come free. @Embeddable public record Money(BigDecimal amount, String currency) {}