Is it possible for a JPA embeddable to contain Embeddable or Collection of Embeddables?

前端 未结 1 868
轻奢々
轻奢々 2021-02-20 10:52

I wonder whether it is possible to have an ElementCollection of Embeddable inside another Embeddable ?

Here\'s an example of my Supplier entity which has a list of Addre

相关标签:
1条回答
  • 2021-02-20 11:51

    JPA 2 spec says no.

    JSR-317

    2.6 Collections of Embeddable Classes and Basic Types

    An embeddable class (including an embeddable class within another embeddable class) that is contained within an element collection must not contain an element collection, nor may it contain a relationship to an entity other than a many-to-one or one-to-one relationship

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