开发者

Annotation equivalent to Component in Hibernate

开发者 https://www.devze.com 2023-02-26 10:12 出处:网络
I am aware that using thecomponent tag I can use a part of the class and make it available in an entity in hibernate.

I am aware that using the component tag I can use a part of the class and make it available in an entity in hibernate.

How do i achieve this through annotations. Or otherwise, what is the annotation equivalent to tag.

@Embedded isn't exact solution as in my case i need only few fields from the one which i intend to use as 开发者_开发知识库component.

Kindly throw some light.


Did you try @Embeddable along with @Column and @Transient?

Also, it might be better to extract the 'component' into its own class and use it in the entity as well as the original class (where the fields were defined before extraction).

0

精彩评论

暂无评论...
验证码 换一张
取 消