It's kind like this:
Code:
<hibernate-mapping
>
<class
name="com.waybrasil.model.persistence.pontoproduto.PontoProduto"
table="VW_SOA_PONTO_PRODUTO"
>
<composite-id
name="pk"
class="com.waybrasil.model.persistence.pontoproduto.PontoProdutoPK"
>
<key-property
name="codigoReceita"
type="com.waybrasil.model.enums.CodigoReceitaEnum"
column="CODREC"
/>
<key-property
name="cidade"
type="java.lang.Integer"
column="CODCID"
/>
<key-property
name="contrato"
type="java.lang.Integer"
column="CONTRA"
/>
<key-property
name="ponto"
type="java.lang.Integer"
column="PONTO"
/>
</composite-id>
<property
name="codigoProgramacao"
type="java.lang.Integer"
update="true"
insert="true"
column="CODPROG"
/>
<property
name="dataConexao"
type="java.util.Date"
update="true"
insert="true"
column="DTCONE"
/>
<property
name="dataDesconexao"
type="java.util.Date"
update="true"
insert="true"
column="DTDESC"
/>
<property
name="descricao"
type="java.lang.String"
update="true"
insert="true"
column="DESCPROG"
/>
<property
name="lancamento"
type="java.lang.String"
update="true"
insert="true"
column="LACAMENTO"
/>
<property
name="local"
type="java.lang.String"
update="true"
insert="true"
column="LOCAL"
/>
<property
name="statusConexao"
type="com.waybrasil.model.enums.SituacaoContratoEnum"
update="true"
insert="true"
column="CODSIT"
/>
<property
name="valor"
type="java.lang.Double"
update="true"
insert="true"
column="VALOR"
/>
<property
name="valorAluguel"
type="java.lang.Double"
update="true"
insert="true"
column="VALOR_ALUGUEL"
/>
<property
name="dataUltimaAtualizacao"
type="java.util.Date"
update="true"
insert="true"
column="DTULTALT"
/>
<property
name="permiteDowngrade"
type="com.waybrasil.model.enums.SimNaoEnum"
update="true"
insert="true"
column="FLAGALT"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-PontoProduto.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
<hibernate-mapping
>
<class
name="com.waybrasil.model.persistence.pacote.Pacote"
table="VW_SOA_PACOTE"
>
<composite-id
name="pk"
class="com.waybrasil.model.persistence.pacote.PacotePK"
>
<key-property
name="codigoPacote"
type="java.lang.Integer"
column="CODPROG"
/>
<key-property
name="codigoCidade"
type="java.lang.Integer"
column="CODCID"
/>
</composite-id>
<property
name="ativo"
type="com.waybrasil.model.enums.SimNaoEnum"
update="true"
insert="true"
column="ATIVO"
/>
<property
name="codigoReceita"
type="com.waybrasil.model.enums.CodigoReceitaEnum"
update="true"
insert="true"
column="CODREC"
/>
<property
name="descricao"
type="java.lang.String"
update="true"
insert="true"
column="DESCPROG"
/>
<property
name="tipoPonto"
type="com.waybrasil.model.enums.TipoPontoEnum"
update="true"
insert="true"
column="TPONTO"
/>
<property
name="valor"
type="java.lang.Double"
update="true"
insert="true"
column="VALOR"
/>
<property
name="categoria"
type="com.waybrasil.model.enums.CategoriaPlanoEnum"
update="true"
insert="true"
column="CATEGORIA"
/>
<property
name="quantidade"
type="java.lang.Integer"
update="true"
insert="true"
column="QTDE"
/>
<property
name="codigoGrupoServico"
type="java.lang.Integer"
update="true"
insert="true"
column="CODGRSER"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Pacote.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
And I'd like to have PontoProduto to have a one-to-many relationship with Pacote.
any ideas?
Best Regards