How to persist a new entity containing multiple identical instances of another unpersisted entity with spring-boot and JPA?

前端 未结 1 500

Overview:

I\'m building a spring-boot application which, in part, retrieves some entities from an external REST service and compares it to previous vers

1条回答
  •  被撕碎了的回忆
    2021-02-09 08:26

    After days of search, I finally solved this in my spring boot project.

    Add follwing blocks in the application.yaml file:

      jpa:
        properties:
          hibernate:
            enable_lazy_load_no_trans: true
            event:
              merge:
                entity_copy_observer: allow
    

    0 讨论(0)
提交回复
热议问题