Java Reference
In-Depth Information
<field name="city">
<column name="DELIVERY_CITY"/>
</field>
<field name="state">
<column name="DELIVERY_STATE"/>
</field>
<field name="zip">
<column name="DELIVERY_ZIP"/>
</field>
</embedded>
</field>
E
Maps
deliveryAddress field
F
Maps
restaurant field
<field name="restaurant">
<column name="RESTAURANT_ID"
target="RESTAURANT_ID"/>
</field>
<field name="lineItems">
<collection
element-type="PendingOrderLineItem"
dependent-element="true"/>
<element>
<column name="PENDING_ORDER_ID"
allows-null="false"/>
</element>
<order column="LINE_ITEM_INDEX"/>
</field>
…
</class>
…
</jdo>
G
Maps
lineItems field
Let's look at the details of the mapping:
B
This maps the
PendingOrder
class to the
PENDING_ORDER
table and specifies
that it uses application identity.
C
This section specifies that
id
is the primary key field and that primary keys should
be generated using a database-approach mechanism.
D
This maps simple fields such as
deliveryTime
to columns of the
PENDING_ORDER
table.
E
This section maps the fields of
deliveryAddress
to the columns of the
PENDING_ORDER
table. The
null-indicator-column
specifies that if the
DELIVERY_STREET1
column is
null
, then
deliveryAddress
is
null
.
Search WWH ::
Custom Search