Annotation equivalent to Component 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).
精彩评论