-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate mapping problem.
PostPosted: Mon Jun 13, 2011 4:56 pm 
Newbie

Joined: Mon Jun 13, 2011 4:41 pm
Posts: 1
hi i have this problem

[org.hibernate.MappingException: Repeated column in mapping for entity: mx.gob.i
mss.cia.spes.integracion.hbm.CptComponente column: ID_NSS (should be mapped with
insert="false" update="false")]

so, my tables are


CREATE TABLE "SPES_OWNER"."CPT_AFILIADO"
(
"ID_NSS" CHAR(11 BYTE) NOT NULL ENABLE,
"NOM_APELLIDO_PATERNO" VARCHAR2(35 BYTE),
"NOM_APELLIDO_MATERNO" VARCHAR2(35 BYTE),
"NOM_NOMBRE" VARCHAR2(40 BYTE),
"FEC_INSCRIPCION_IMSS" DATE,
"FEC_MODIFICACION" DATE,
"FEC_NACIMIENTO" DATE,
"FEC_DEFUNCION" DATE,
"CVE_RFC" CHAR(13 BYTE),
"CVE_CURP" CHAR(18 BYTE),
"CVE_SUBDELEGACION" VARCHAR2(2 BYTE),
"ID_ASEGURADORA" CHAR(3 BYTE),
"CVE_SEXO" NUMBER(1,0),
"FEC_ELECCION_ASEGURADORA" DATE,
"FEC_INICIO_AJUSTE" DATE,
"ID_REFORMA_LEY" VARCHAR2(8 BYTE),
"FEC_REFORMA_LEY" DATE,
"ID_ESTADO_NOMINA" CHAR(2 BYTE),
"IND_NOMINA_PROCESADA" CHAR(1 BYTE),
"CVE_DELEGACION" VARCHAR2(2 BYTE),
"ID_ESTADO_CIVIL" CHAR(1 BYTE),
"CVE_AFORE" VARCHAR2(3 BYTE),
"NUM_CAMBIO_ASEGURADORA" NUMBER(1,0),
"FEC_BAJA" DATE,
"ID_TIPO_MOVIMIENTO" CHAR(2 BYTE),
"CVE_PERIODO_NOMINA" NUMBER(6,0),
"CVE_USUARIO" VARCHAR2(20 BYTE),
"FEC_MOVIMIENTO" DATE,
CONSTRAINT "CPCNS_PK_TAFI_NSS" PRIMARY KEY ("ID_NSS") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 104857600 NEXT 104857600 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SP_TS_DATA01_COFEMER" ENABLE,
CONSTRAINT "CPCNS_FK_AFORAFIL_CVEAFORE" FOREIGN KEY ("CVE_AFORE") REFERENCES "SPES_CATCOMUN"."CAT_AFORES" ("CVE_AFORE") ENABLE,
CONSTRAINT "CPCNS_FK_SUBDAFIL_CVESUBDEL" FOREIGN KEY ("CVE_DELEGACION", "CVE_SUBDELEGACION") REFERENCES "SPES_CATCOMUN"."CAT_SUBDELEGACIONES" ("CVE_DELEGACION", "CVE_SUBDELEGACION") ENABLE,
CONSTRAINT "CPCNS_FK_ASEGAFIL_ID" FOREIGN KEY ("ID_ASEGURADORA") REFERENCES "SPES_OWNER"."SPC_ASEGURADORA" ("ID_ASEGURADORA") ENABLE,
CONSTRAINT "CPCNS_FK_SEXOAFIL_CVESEXO" FOREIGN KEY ("CVE_SEXO") REFERENCES "SPES_CATCOMUN"."CAT_SEXO" ("CVE_SEXO") ENABLE,
CONSTRAINT "CPCNS_FK_TMOVAFIL_IDTMOV" FOREIGN KEY ("ID_TIPO_MOVIMIENTO") REFERENCES "SPES_OWNER"."SPC_TIPO_MOVIMIENTO" ("ID_TIPO_MOVIMIENTO") ENABLE,
CONSTRAINT "CPCNS_FK_RLEYAFIL_IDRLEY" FOREIGN KEY ("ID_REFORMA_LEY") REFERENCES "SPES_OWNER"."SPC_REFORMA_LEY" ("ID_REFORMA_LEY") ENABLE,
CONSTRAINT "CPCNS_FK_EDOCAFIL_IDEDOCIVIL" FOREIGN KEY ("ID_ESTADO_CIVIL") REFERENCES "SPES_OWNER"."SPC_ESTADO_CIVIL" ("ID_ESTADO_CIVIL") ENABLE
)

and

CREATE TABLE "SPES_OWNER"."CPT_COMPONENTE"
(
"ID_NSS" CHAR(11 BYTE) NOT NULL ENABLE,
"ID_COMPONENTE" CHAR(2 BYTE) NOT NULL ENABLE,
"ID_GRUPO_FAMILIAR" CHAR(2 BYTE),
"NOM_APELLIDO_PATERNO" VARCHAR2(35 BYTE),
"NOM_APELLIDO_MATERNO" VARCHAR2(35 BYTE),
"NOM_NOMBRE" VARCHAR2(40 BYTE),
"FEC_VENCIMIENTO" DATE,
"FEC_INICIO_AJUSTE" DATE,
"FEC_REFORMA_LEY" DATE,
"IND_PENSION_FONDO_ESPE" CHAR(1 BYTE),
"FEC_NACIMIENTO" DATE,
"IMP_MONTO_MIN_VIUDEZ" NUMBER(13,2),
"CVE_CURP" CHAR(18 BYTE),
"IMP_DIF_MONTO_MIN_VIUDEZ" NUMBER(13,2),
"POR_ASIGNACION_LEY" NUMBER(5,2),
"IMP_CUANTIA_MENSUAL" NUMBER(13,2),
"POR_AYUDA_ASISTENCIAL" NUMBER(5,2),
"IMP_AYUDA_ASISTENCIAL" NUMBER(13,2),
"IMP_REFORMA_LEY" NUMBER(13,2),
"FEC_BAJA_SUSPENSION" DATE,
"FEC_MODIFICACION" DATE,
"ID_PARENTESCO" CHAR(2 BYTE),
"ID_INCIDENCIA" CHAR(2 BYTE),
"ID_PERIODO_ESCOLAR" CHAR(2 BYTE),
"ID_NIVEL_ESTUDIOS" CHAR(2 BYTE),
"ID_REFORMA_LEY" VARCHAR2(8 BYTE),
"ID_ORFANDAD" CHAR(1 BYTE),
"CVE_SEXO" NUMBER(1,0),
"ID_CALENDARIO_ESCOLAR" CHAR(2 BYTE),
"ID_NUM_PERIODO_ESCOLAR" CHAR(2 BYTE),
"IND_FINIQUITO" CHAR(1 BYTE),
"CVE_PERIODO_NOMINA_FINIQUITO" NUMBER(6,0),
"IND_TITULAR_GRUPO" CHAR(1 BYTE),
"IND_IMPRESION" CHAR(1 BYTE),
"IMP_DIF_MONTO_MINIMO_PMG" NUMBER(13,2),
"CVE_PERIODO_NOMINA" NUMBER(6,0),
"ID_TIPO_MOVIMIENTO" CHAR(2 BYTE),
"NUM_FOLIO_DICTAMEN" NUMBER(9,0),
"FEC_MOVIMIENTO" DATE,
CONSTRAINT "CPCNS_PK_COMP_N_NSSCOMP" PRIMARY KEY ("ID_NSS", "ID_COMPONENTE") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 104857600 NEXT 104857600 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SP_TS_DATA01_COFEMER" ENABLE,
CONSTRAINT "CPCNS_FK_SEXOCOMP_CVE" FOREIGN KEY ("CVE_SEXO") REFERENCES "SPES_CATCOMUN"."CAT_SEXO" ("CVE_SEXO") ENABLE,
CONSTRAINT "CPCNS_FK_CESCCOMP_ID" FOREIGN KEY ("ID_CALENDARIO_ESCOLAR") REFERENCES "SPES_OWNER"."SPC_CALENDARIO_ESCOLAR" ("ID_CALENDARIO_ESCOLAR") ENABLE,
CONSTRAINT "CPCNS_FK_NESCCOMP_NUM" FOREIGN KEY ("ID_NUM_PERIODO_ESCOLAR") REFERENCES "SPES_OWNER"."SPC_NUMERO_PERIODO_ESCOLAR" ("ID_NUM_PERIODO_ESCOLAR") ENABLE,
CONSTRAINT "CPCNS_FK_GPOFCOMP_NSSGPOF" FOREIGN KEY ("ID_NSS", "ID_GRUPO_FAMILIAR") REFERENCES "SPES_OWNER"."CPT_GRUPO_FAMILIAR" ("ID_NSS", "ID_GRUPO_FAMILIAR") ENABLE,
CONSTRAINT "CPCNS_FK_AFILCOMP_NSS" FOREIGN KEY ("ID_NSS") REFERENCES "SPES_OWNER"."CPT_AFILIADO" ("ID_NSS") ENABLE,
CONSTRAINT "CPCNS_FK_PARECOMP_ID" FOREIGN KEY ("ID_PARENTESCO") REFERENCES "SPES_OWNER"."SPC_PARENTESCO" ("ID_PARENTESCO") ENABLE,
CONSTRAINT "CPCNS_FK_INCICOMP_ID" FOREIGN KEY ("ID_INCIDENCIA") REFERENCES "SPES_OWNER"."SPC_INCIDENCIA" ("ID_INCIDENCIA") ENABLE,
CONSTRAINT "CPCNS_FK_PESCCOMP_ID" FOREIGN KEY ("ID_PERIODO_ESCOLAR") REFERENCES "SPES_OWNER"."SPC_PERIODO_ESCOLAR" ("ID_PERIODO_ESCOLAR") ENABLE,
CONSTRAINT "CPCNS_FK_NESTCOMP_NIVEL" FOREIGN KEY ("ID_NIVEL_ESTUDIOS") REFERENCES "SPES_OWNER"."SPC_NIVEL_ESTUDIOS" ("ID_NIVEL_ESTUDIOS") ENABLE,
CONSTRAINT "CPCNS_FK_RLEYCOMP_LEY" FOREIGN KEY ("ID_REFORMA_LEY") REFERENCES "SPES_OWNER"."SPC_REFORMA_LEY" ("ID_REFORMA_LEY") ENABLE,
CONSTRAINT "CPCNS_FK_ORFACOMP_ID" FOREIGN KEY ("ID_ORFANDAD") REFERENCES "SPES_OWNER"."SPC_ORFANDAD" ("ID_ORFANDAD") ENABLE,
CONSTRAINT "CPCNS_FK_TMOVCOMP_TMOV" FOREIGN KEY ("ID_TIPO_MOVIMIENTO") REFERENCES "SPES_OWNER"."SPC_TIPO_MOVIMIENTO" ("ID_TIPO_MOVIMIENTO") ENABLE
)


the mapping files are



<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin

http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->

<class
name="mx.gob.imss.cia.spes.integracion.hbm.CptAfiliado"
table="CPT_AFILIADO"
>

<id
name="idNss"
type="java.lang.String"
column="ID_NSS"
>
<generator class="assigned" />
</id>

<property
name="nomApellidoPaterno"
type="java.lang.String"
column="NOM_APELLIDO_PATERNO"
length="35"
/>
<property
name="nomApellidoMaterno"
type="java.lang.String"
column="NOM_APELLIDO_MATERNO"
length="35"
/>
<property
name="nomNombre"
type="java.lang.String"
column="NOM_NOMBRE"
length="40"
/>
<property
name="fecInscripcionImss"
type="java.sql.Timestamp"
column="FEC_INSCRIPCION_IMSS"
length="7"
/>
<property
name="fecModificacion"
type="java.sql.Timestamp"
column="FEC_MODIFICACION"
length="7"
/>
<property
name="fecNacimiento"
type="java.sql.Timestamp"
column="FEC_NACIMIENTO"
length="7"
/>
<property
name="fecDefuncion"
type="java.sql.Timestamp"
column="FEC_DEFUNCION"
length="7"
/>
<property
name="cveRfc"
type="java.lang.String"
column="CVE_RFC"
length="13"
/>
<property
name="cveCurp"
type="java.lang.String"
column="CVE_CURP"
length="18"
/>
<property
name="cveSubdelegacion"
type="java.lang.String"
column="CVE_SUBDELEGACION"
length="2"
/>
<property
name="idAseguradora"
type="java.lang.String"
column="ID_ASEGURADORA"
length="3"
/>
<property
name="cveSexo"
type="java.lang.String"
column="CVE_SEXO"
length="1"
/>
<property
name="fecEleccionAseguradora"
type="java.sql.Timestamp"
column="FEC_ELECCION_ASEGURADORA"
length="7"
/>
<property
name="fecInicioAjuste"
type="java.sql.Timestamp"
column="FEC_INICIO_AJUSTE"
length="7"
/>
<property
name="idReformaLey"
type="java.lang.String"
column="ID_REFORMA_LEY"
length="8"
/>
<property
name="fecReformaLey"
type="java.sql.Timestamp"
column="FEC_REFORMA_LEY"
length="7"
/>
<property
name="idEstadoNomina"
type="java.lang.String"
column="ID_ESTADO_NOMINA"
length="2"
/>
<property
name="indNominaProcesada"
type="java.lang.String"
column="IND_NOMINA_PROCESADA"
length="1"
/>
<property
name="cveDelegacion"
type="java.lang.String"
column="CVE_DELEGACION"
length="2"
/>
<property
name="idEstadoCivil"
type="java.lang.String"
column="ID_ESTADO_CIVIL"
length="1"
/>
<property
name="cveAfore"
type="java.lang.String"
column="CVE_AFORE"
length="3"
/>
<property
name="numCambioAseguradora"
type="boolean"
column="NUM_CAMBIO_ASEGURADORA"
length="1"
/>
<property
name="fecBaja"
type="java.sql.Timestamp"
column="FEC_BAJA"
length="7"
/>
<property
name="idTipoMovimiento"
type="java.lang.String"
column="ID_TIPO_MOVIMIENTO"
length="2"
/>
<property
name="cvePeriodoNomina"
type="int"
column="CVE_PERIODO_NOMINA"
length="6"
/>
<property
name="cveUsuario"
type="java.lang.String"
column="CVE_USUARIO"
length="20"
/>
<property
name="fecMovimiento"
type="java.sql.Timestamp"
column="FEC_MOVIMIENTO"
length="7"
/>

<!-- associations -->
<!-- bi-directional one-to-many association to CptComponente -->
<set
name="cptComponentes"
lazy="true"
inverse="true"
>
<key>
<column name="ID_NSS" />
</key>
<one-to-many
class="mx.gob.imss.cia.spes.integracion.hbm.CptComponente"
/>
</set>
<!-- bi-directional one-to-many association to CptOrdenIngreso -->
<set
name="cptOrdenIngresos"
lazy="true"
inverse="true"
>
<key>
<column name="ID_NSS" />
</key>
<one-to-many
class="mx.gob.imss.cia.spes.integracion.hbm.CptOrdenIngreso"
/>
</set>
<!-- bi-directional one-to-many association to CptGrupoFamiliar -->
<set
name="cptGrupoFamiliars"
lazy="true"
inverse="true"
>
<key>
<column name="ID_NSS" />
</key>
<one-to-many
class="mx.gob.imss.cia.spes.integracion.hbm.CptGrupoFamiliar"
/>
</set>
<!-- bi-directional one-to-many association to CptCheque -->
<set
name="cptCheques"
lazy="true"
inverse="true"
>
<key>
<column name="ID_NSS" />
</key>
<one-to-many
class="mx.gob.imss.cia.spes.integracion.hbm.CptCheque"
/>
</set>

</class>
</hibernate-mapping>



and



<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin

http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->

<class name="mx.gob.imss.cia.spes.integracion.hbm.CptComponente"
table="CPT_COMPONENTE">

<composite-id name="comp_id" class="mx.gob.imss.cia.spes.integracion.hbm.CptComponentePK">
<key-property
name="idComponente"
column="ID_COMPONENTE"
type="java.lang.String"
length="2"
/>
<!-- bi-directional many-to-one association to CptAfiliado -->
<key-many-to-one
name="cptAfiliado"
class="mx.gob.imss.cia.spes.integracion.hbm.CptAfiliado">
<column name="ID_NSS" />
</key-many-to-one>
</composite-id>

<property
name="nomApellidoPaterno"
type="java.lang.String"
column="NOM_APELLIDO_PATERNO"
length="35"
/>
<property
name="nomApellidoMaterno"
type="java.lang.String"
column="NOM_APELLIDO_MATERNO"
length="35"
/>
<property
name="nomNombre"
type="java.lang.String"
column="NOM_NOMBRE"
length="40"
/>
<property
name="fecVencimiento"
type="java.sql.Timestamp"
column="FEC_VENCIMIENTO"
length="7"
/>
<property
name="fecInicioAjuste"
type="java.sql.Timestamp"
column="FEC_INICIO_AJUSTE"
length="7"
/>
<property
name="fecReformaLey"
type="java.sql.Timestamp"
column="FEC_REFORMA_LEY"
length="7"
/>
<property
name="indPensionFondoEspe"
type="java.lang.String"
column="IND_PENSION_FONDO_ESPE"
length="1"
/>
<property
name="fecNacimiento"
type="java.sql.Timestamp"
column="FEC_NACIMIENTO"
length="7"
/>
<property
name="impMontoMinViudez"
type="java.math.BigDecimal"
column="IMP_MONTO_MIN_VIUDEZ"
length="13"
/>
<property
name="cveCurp"
type="java.lang.String"
column="CVE_CURP"
length="18"
/>
<property
name="impDifMontoMinViudez"
type="java.math.BigDecimal"
column="IMP_DIF_MONTO_MIN_VIUDEZ"
length="13"
/>
<property
name="porAsignacionLey"
type="java.math.BigDecimal"
column="POR_ASIGNACION_LEY"
length="5"
/>
<property
name="impCuantiaMensual"
type="java.math.BigDecimal"
column="IMP_CUANTIA_MENSUAL"
length="13"
/>
<property
name="porAyudaAsistencial"
type="java.math.BigDecimal"
column="POR_AYUDA_ASISTENCIAL"
length="5"
/>
<property
name="impAyudaAsistencial"
type="java.math.BigDecimal"
column="IMP_AYUDA_ASISTENCIAL"
length="13"
/>
<property
name="impReformaLey"
type="java.math.BigDecimal"
column="IMP_REFORMA_LEY"
length="13"
/>
<property
name="fecBajaSuspension"
type="java.sql.Timestamp"
column="FEC_BAJA_SUSPENSION"
length="7"
/>
<property
name="fecModificacion"
type="java.sql.Timestamp"
column="FEC_MODIFICACION"
length="7"
/>
<property
name="idParentesco"
type="java.lang.String"
column="ID_PARENTESCO"
length="2"
/>
<property
name="idIncidencia"
type="java.lang.String"
column="ID_INCIDENCIA"
length="2"
/>
<property
name="idPeriodoEscolar"
type="java.lang.String"
column="ID_PERIODO_ESCOLAR"
length="2"
/>
<property
name="idNivelEstudios"
type="java.lang.String"
column="ID_NIVEL_ESTUDIOS"
length="2"
/>
<property
name="idReformaLey"
type="java.lang.String"
column="ID_REFORMA_LEY"
length="8"
/>
<property
name="idOrfandad"
type="java.lang.String"
column="ID_ORFANDAD"
length="1"
/>
<property
name="cveSexo"
type="java.lang.Integer"
column="CVE_SEXO"
length="1"
/>
<property
name="idCalendarioEscolar"
type="java.lang.String"
column="ID_CALENDARIO_ESCOLAR"
length="2"
/>
<property
name="idNumPeriodoEscolar"
type="java.lang.String"
column="ID_NUM_PERIODO_ESCOLAR"
length="2"
/>
<property
name="indFiniquito"
type="java.lang.String"
column="IND_FINIQUITO"
length="1"
/>
<property
name="cvePeriodoNominaFiniquito"
type="int"
column="CVE_PERIODO_NOMINA_FINIQUITO"
length="6"
/>
<property
name="indTitularGrupo"
type="java.lang.String"
column="IND_TITULAR_GRUPO"
length="1"
/>
<property
name="indImpresion"
type="java.lang.String"
column="IND_IMPRESION"
length="1"
/>
<property
name="impDifMontoMinimoPmg"
type="java.math.BigDecimal"
column="IMP_DIF_MONTO_MINIMO_PMG"
length="13"
/>
<property
name="cvePeriodoNomina"
type="int"
column="CVE_PERIODO_NOMINA"
length="6"
/>
<property
name="idTipoMovimiento"
type="java.lang.String"
column="ID_TIPO_MOVIMIENTO"
length="2"
/>
<property
name="numFolioDictamen"
type="int"
column="NUM_FOLIO_DICTAMEN"
length="9"
/>
<property
name="fecMovimiento"
type="java.sql.Timestamp"
column="FEC_MOVIMIENTO"
length="7"
/>

<!-- associations -->
<!-- bi-directional many-to-one association to CptGrupoFamiliar -->
<many-to-one
name="cptGrupoFamiliar"
class="mx.gob.imss.cia.spes.integracion.hbm.CptGrupoFamiliar"
not-null="true"
>
<column name="ID_NSS" />
<column name="ID_GRUPO_FAMILIAR" />
</many-to-one>
<!-- bi-directional one-to-many association to CptChequeDetalleConcepto -->
<set
name="cptChequeDetalleConceptos"
lazy="true"
inverse="true"
>
<key>
<column name="ID_NSS" />
<column name="ID_COMPONENTE" />
</key>
<one-to-many
class="mx.gob.imss.cia.spes.integracion.hbm.CptChequeDetalleConcepto"
/>
</set>
<!-- bi-directional one-to-many association to CptOrdenDetalleConcepto -->
<set
name="cptOrdenDetalleConceptos"
lazy="true"
inverse="true"
>
<key>
<column name="ID_NSS" />
<column name="ID_COMPONENTE" />
</key>
<one-to-many
class="mx.gob.imss.cia.spes.integracion.hbm.CptOrdenDetalleConcepto"
/>
</set>

</class>
</hibernate-mapping>


any idea for fix this problem

thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.