Hi,
I would like to model a contract, with a revisable archived state (ie one or more state per contract). Each state itself may relate to one or more future financial operations. A state without its contract, as a future financial operation without its related state, means nothing. So the composition appears to be a good choice.
The following mapping is what I try. The schema generator issues a MappingException
(could not find class: void). What's wrong with this mapping ?
Thanks in advance for any help.
Loïc
In Contrat.hbm.xml :
Code:
<list name="etats" lazy="true">
<key column="idContrat" />
<index column="date" />
<composite-element class="contrat.EtatContrat">
<property name="date" type="java.util.Date" update="true" insert="true" column="date" not-null="true" />
<many-to-one name="contrat" class="contrat.Contrat" cascade="none" outer-join="auto"
update="true" insert="true" column="idContrat" not-null="true" />
<nested-composite-element class="contrat.FluxFinancier" name="fluxFinanciersFuturs">
<property name="dateEcheance" type="java.util.Date" update="true" insert="true" column="dateEcheance"
not-null="true" />
<property name="montant" type="java.math.BigDecimal" update="true" insert="true" column="montant"
not-null="true" />
<many-to-one name="etatContrat" class="contrat.EtatContrat" cascade="none"
outer-join="auto" update="true" insert="true" column="idEtatContrat" not-null="true" />
</nested-composite-element>
</composite-element>
</list>