Add Money embeddable value object (corner-scenario enrichment)

This commit is contained in:
2026-07-25 08:18:27 +00:00
parent b3db1a66e7
commit 34cba41805

View File

@@ -0,0 +1,10 @@
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) {}