Open
Description
I'm looking at implementing a read and write converters for an embedded object in a row that may exist in two forms.
The specific example is a MonetaryAmount that contains two fields (amount, currency code) in order to properly generate a Monetary Amount. The parent object's row contains two instances of this object differed by its prefix (e.g., MSRP, and say Shipping Cost, could be more but just for keeping things simple in this issue, let's assume that there are two instances of this type in the row). Is there a way to annotate an object similar to how JPA supports embeddables w/ a prefix declaration w/ a converter to distinguish the fields?
Sample Entity:
// some imports
import javax.money.MonetaryAmount;
/// other imports
public class Product {
@Id
@GtinConstraint
@Getter
private String id;
private String title;
private String description;
private MonetaryAmount listPrice;
private MonetaryAmount shippingCost;
}