You can consider "an aggregate, which is part of another aggregate" as "an aggregate holds another aggregate's reference".
For example
public class Order {
private Invoice invoice;
}
<class name="Order" table="T_ORDER">
<one-to-one name="invoice" column="INVOICE_ID" />
</class>
If both Order and Invoice are aggregates in this context, I'll have a OrderRepository and a InvoiceRepository.You can retrieve an Order using
orderRepository.findBy(orderId)
And you can retrieve an Invoice using
invoiceRepository.findBy(invoiceId)
or
Order order = orderRepository.findBy(orderId);
Invoice invoice = order.getInvoice();
And there is famous article about how to design aggregates(http://dddcommunity.org/library/vernon_2011/) which suggests realizing this relationships using Identity reference.
public Class Order {
private InvoiceId invoiceId;
}
<class name="Order" table="T_ORDER">
<component name="invoiceId">
<property name="value" column="INVOICE_ID" />
</component>
</class>
You can retrieve an Order using
orderRepository.findBy(orderId)
And you can retrieve an Invoice using
invoiceRepository.findBy(invoiceId)
or
Order order = orderRepository.findBy(orderId);
Invoice invoice = invoiceRepository.findBy(order.getInvoiceId());