Is it possible to mapping this class model?, or it is impossible mapping a collection of a component that has another collection of components?
The mapping is below the image.
Code:
<class name="src.model.Orcamento" table="ORCAMENTO">
<id name="id" column="ORCAMENTO_ID">
<generator class="sequence">
<param name="sequence">ORCAMENTO_GEN</param>
</generator>
</id>
<version name="versao" column="VERSAO" />
<property name="descricao" not-null="true" />
<property name="data" not-null="true" />
<property name="valor" not-null="false" />
<many-to-one name="cliente" column="CLIENTE_ID"
not-null="true" />
<idbag name="itens" lazy="true" cascade="all-delete-orphan"
table="ITEM_ORCAMENTO">
<collection-id type="integer"
column="ITEM_ORCAMENTO_ID">
<generator class="sequence">
<param name="sequence">
ITEM_ORCAMENTO_GEN
</param>
</generator>
</collection-id>
<key column="ORCAMENTO_ID" not-null="true"
on-delete="cascade" />
<composite-element class="src.model.ItemOrcamento">
<property name="total" />
<property name="descricao" />
<idbag name="partes" lazy="true"
cascade="all-delete-orphan" table="PARTE_ITEM">
<collection-id type="integer"
column="PARTE_ITEM_ID">
<generator class="sequence">
<param name="sequence">
PARTE_ITEM_GEN
</param>
</generator>
</collection-id>
<key column="ITEM_ORCAMENTO_ID" not-null="true"
on-delete="cascade" />
<composite-element
class="src.model.ParteDeItem">
<property name="nome" />
<idbag name="materiais" lazy="true"
cascade="all-delete-orphan" table="MATERIAL">
<collection-id type="integer"
column="MATERIAL_ID">
<generator class="sequence">
<param name="sequence">
MATERIAL_GEN
</param>
</generator>
</collection-id>
<key column="PARTE_ITEM_ID"
not-null="true" on-delete="cascade" />
<composite-element
class="src.model.Material">
<property name="quantidade" />
<many-to-one
name="descricaoMaterial" column="DESCRICAO_MATERIAL_ID"
fetch="join" />
</composite-element>
</idbag>
</composite-element>
</idbag>
<joined-subclass name="Armazem"
table="ARMAZEM">
<key column="ARMAZEM_ID" />
<property name="volumeProduto" column="VOLUME_PRODUTO" not-null="true"/>
<property name="modulcao" not-null="true"/>
<property name="comprimento" not-null="true"/>
<property name="area" not-null="true"/>
<property name="eixo1" not-null="true"/>
<property name="eixo2" not-null="true"/>
<property name="alturaFechamentoEixo1" column="ALTURA_FECH_EIXO1" not-null="true"/>
<property name="alturaFechamentoEixo2" column="ALTURA_FECH_EIXO2" not-null="true"/>
<property name="alturaFechamentoOitao" column="ALTURA_FECH_OITAO" not-null="true"/>
<property name="compFechamentoLateralOitao" column="COMP_FECH_LAT_OITAO" not-null="true"/>
<property name="qtdEstruturas" column="QTD_ESTRUTURA" not-null="true"/>
<property name="qtdPorticoDuplo" column="QTD_PORTICO_DUPLO" not-null="true"/>
<property name="qtdPorticoSimples" column="QTD_PORTICO_SIMPLES" not-null="true"/>
<property name="qtdPorticoTriplo" column="QTD_PORTICO_TRIPLO" not-null="true"/>
<property name="alturaProduto" column="ALTURA_PRODUTO" not-null="true"/>
<property name="vaoProduto" column="VAO_PRODUTO" not-null="true"/>
<property name="qtdBarreiras" column="QTD_BARREIRAS" not-null="true"/>
<property name="alturaBarreiraFrontal" column="ALTURA_BARREIRA_FRONTAL" not-null="true"/>
<property name="calcularFechamentoLateralOitao" column="CALCULAR_FECHAMENTO_LAT_OITAO" not-null="true"/>
</joined-subclass>
</composite-element>
</idbag>
</class>