Hibernate 4 explicit polymorphism (annotation) not working?

前端 未结 2 1757
南笙
南笙 2021-01-18 01:34

I am facing problem with hibernate\'s explicit polymorphism. I used the polymorphism annotation and set it to explicit, but with get() and collections in mapped classes i al

2条回答
  •  轮回少年
    2021-01-18 02:19

    If you look at the definition of PolymorphismType.EXPLICIT it says:

    EXPLICIT: This entity is retrieved only if explicitly asked.

    To hide the subclasses, you will have to annotate the subclasses with EXPLICIT and not the base class.

提交回复
热议问题