hibernate - multiple levels of nesting component in JPA -
i know using hibernate mapping files can nest 1 component inside another. example:
<?xml version="1.0" encoding="utf-8"?> <!doctype hibernate-mapping public "-//hibernate/hibernate mapping dtd 3.0//en" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="com.hibernaterecipes.chapter3"> <class name="orders" table="book_orders"> <id name="id" type="long" column="id"> <generator class="native" /> </id> <component name="weekdaycontact" class="contact"> <property name="recipient" type="string" column="weekday_recipient" /> <component name="phone" class="phone"> <property name="areacode" type="string" column="weekday_areacode" /> <property name="telno" type="string" column="weekday_telephone" /> </component> <property name="address" type="string" column="weekday_address" /> </component> <component name="holidaycontact" class="contact"> <property name="recipient" type="string" column="holiday_recipient" /> <component name="phone" class="phone"> <property name="areacode" type="string" column="holiday_areacode" > <property name="telno" type="string" column="holiday_telephone" /> </component> <property name="address" type="string" column="holiday_address" /> </component> </class> </hibernate-mapping>
as per understanding cannot same jpa.is understanding correct?
as per understanding can same jpa.is understanding correct?
yes , no. jpa 1.0 supports properties follows rules basic annotation, meaning doesn't support other @embedded. jpa 2.0 supports it.
Comments
Post a Comment