Skip to content

Entities <-> Records Assembler #1

@m-reza-rahman

Description

@m-reza-rahman

I think the use cases outlined here are good. Does it also make sense to add something for the cases where DTO Record <-> Entity assembly happens outside the direct EntityManager context? Basically I am thinking of a generic utility that formalizes the Assembler Pattern in JPA. The utility could be a part of JPA itself or something that is part of DeltaSpike. The following are some casual examples representing very simple implicit transformation cases.

MyRecord myRecord = JpaDtoAssembler.toRecord(myEntity, MyRecord.class);
...
MyEntity myEntity = JpaDtoAssembler.toEntity(myRecord, MyEntity.class);

Reza Rahman
Jakarta EE Ambassador, Author, Blogger, Speaker

Please note views expressed here are my own as an individual community member and do not reflect the views of my employer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions