2
<!DOCTYPE hibernate-mapping PUBLIC
3
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
4
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
6
<hibernate-mapping package="org.hibernate.test.cid">
10
This mapping demonstrates
12
(1) use of a derived property which performs a
13
subselect against an associated table
15
(2) use of <synchronize/> to ensure that auto-flush
16
works correctly for an entity with a property
17
derived from another table
22
<class name="Product">
23
<synchronize table="LineItem"/>
27
<generator class="assigned"/>
30
<property name="description"
33
<property name="price" length="3" column="cost"/>
34
<property name="numberAvailable"/>
36
<property name="numberOrdered"
37
formula="( select sum(li.quantity) from LineItem li where li.productId = productId )"/>