Integrate 3rd party entities

Hi team,

Some 3rd party Java components has its own entities and full backend logics.

Is there an easy way to integrate 3rd party JPA @Entity with Jmix? For example this one: https://gitee.com/warm_4/warm-flow-jpa/blob/master/warm-flow-jpa-jakarta-core/src/main/java/org/dromara/warm/flow/orm/entity/FlowUser.java

The packages can be included into Jmix with:

implementation 'org.dromara.warm:warm-flow-jpa-sb3-starter:1.6.6'
implementation 'org.dromara.warm:warm-flow-plugin-ui-sb-web:1.6.6'

Hi Bryan,

Unfortunately external entities cannot be used in Jmix directly in compiled form, because the entities must be enhanced to be used in Jmix mechanisms.

Perhaps the easiest way to integrate external models is to write a separate layer of entities and mappers as we do when consuming external APIs, see Integrating Applications Using OpenAPI: Creating Entities and Mappers.

BTW, another obstacle in this particular model is that the entity is annotated with Lombok’s @Data, which generates incorrect equals/hashCode methods and will break Jmix behavior in some cases.

Regards,
Konstantin

2 Likes