0
我是新來的休眠(有c背景),雖然經歷了一些書籍和例子,我總是看到組件嵌入類映射。例如hibernate可以組件是全局的嗎?由其他實體共享?
<hibernate-mapping>
<class name="com.mkyong.customer.Customer" table="customer">
<!-other entity mapping -->
<component name="Address" class="com.mkyong.customer.Address">
<property name="address1" type="string">
<column name="ADDRESS1" not-null="true" />
</property>
<property name="address2" type="string">
<column name="ADDRESS2" not-null="true" />
</property>
</component>
.
.
</class>
</hibernate-mapping>
我的問題是可以組件是全局的,並由任何實體共享?像@Embeddable JPA註釋
我指的是在例如:http://www.mkyong.com/hibernate/hibernate-component-mapping-example/
你問是否有其他組件可以引用這個組件?如果是這樣,那麼是的。 –
任何其他組件或其他實體,如果是的話可以請提供一些例子? – stultus
已發佈一個答案 –