Skip to content

Add support for embedded entities #288

Open
@jackdpeterson

Description

@jackdpeterson

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions