Now, I'm having problems setting the relationship
here is a image of the Database
and my mappings
Code:
<class name="com.br.resource.csu.lembranca.dao.hibernate.persisted.DocumentoRegra" table="SSC_rel_doc_regra">
<composite-id>
<key-many-to-one name="inxRegraCampanha" column="inx_regra_campanha"/>
<key-many-to-one name="docPK" class="com.br.resource.csu.lembranca.dao.hibernate.persisted.DocumentoPK">
<column name="COD_CLI"/>
<column name="inx_doc"/>
</key-many-to-one>
</composite-id>
<property name="datAplicaRegra" column="dat_aplica_regra"/>
<property name="datPrevRegra" column="dat_prev_regra"/>
<property name="indStatusRegra" column="ind_status_regra"/>
<property name="vlrResultRegra" column="vlr_result_regra"/>
<property name="dscObs" column="dsc_obs"/>
<property name="flgRetornoLight" column="FLG_RETORNO_LIGHT"/>
</class>
<class name="com.br.resource.csu.lembranca.dao.hibernate.persisted.Documento" table="SSC_documento">
<composite-id name="docPK" class="com.br.resource.csu.lembranca.dao.hibernate.persisted.DocumentoPK">
<key-many-to-one name="codCli" column="COD_CLI"/>
<key-property name="inxDoc" column="INX_DOC"/>
</composite-id>
<set name="regras" inverse="true" lazy="true" cascade="all">
<key column="inx_doc"/>
<one-to-many class="com.br.resource.csu.lembranca.dao.hibernate.persisted.DocumentoRegra"/>
</set>
<property name="codClasse" column="COD_CLASSE"/>
<property name="codInstalacao" column="COD_INSTALACAO"/>
<property name="codLivroLeitura" column="COD_LIVRO_LEITURA"/>
<property name="codLocalidade" column="COD_LOCALIDADE"/>
<property name="codLoteFaturamento" column="COD_LOTE_FATURAMENTO"/>
<property name="codMotivoExc" column="COD_MOTIVO_EXC"/>
<property name="codTipoDoc" column="COD_TIPO_DOC"/>
<property name="codUnidOper" column="COD_UNID_OPER"/>
<property name="datCriacaoFatura" column="DAT_CRIACAO_FATURA"/>
<property name="datEmissaoFatura" column="DAT_EMISSAO_FATURA"/>
<property name="datExc" column="DAT_EXC"/>
<property name="datFimCob" column="DAT_FIM_COB"/>
<property name="datInclusaoReg" column="DAT_INCLUSAO_REG"/>
<property name="datIniCob" column="DAT_INI_COB"/>
<property name="datPrevCorte" column="DAT_PREV_CORTE"/>
<property name="datProcArqOrg" column="DAT_PROC_ARQ_ORG"/>
<property name="datVenctoFatura" column="DAT_VENCTO_FATURA"/>
<property name="flgDebAut" column="FLG_DEB_AUT"/>
<property name="indContencioso" column="IND_CONTENCIOSO"/>
<property name="mesRefFatura" column="MES_REF_FATURA"/>
<property name="numFatura" column="NUM_FATURA"/>
<property name="qtdTentativa" column="QTD_TENTATIVA"/>
<property name="totFaturaAvisoDeb" column="TOT_FATURA_AVISO_DEB"/>
<property name="vlrFatura" column="VLR_FATURA"/>
</class>