开发者

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).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜