I did not obtain to find where he arranges this
somebody can help me?
:)
Endereco mapping:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : Endereco.hbm.xml
Created on : 9 de Agosto de 2005, 09:28
Author : gian
Description:
Purpose of the document follows.
-->
<!DOCTYPE hibernate-mapping PUBLIC
'-//Hibernate/Hibernate Mapping DTD//En'
'http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd'>
<hibernate-mapping>
<class
name = "net.unesc.kiron.uti.map.Endereco"
table = "ENDERECO">
<id
name = "codEnder"
column="CODENDER"
type="java.lang.Integer">
<generator class = "sequence"/>
</id>
<property
name="codPac"
column="CODPAC"
type="java.lang.Integer"/>
<property
name="logradouro"
column="LOGRADOURO"
type="string"/>
<property
name="numero"
column="NUMERO"
type="java.lang.Integer"/>
</class>
</hibernate-mapping>
Paciente mapping:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : Paciente.hbm.xml
Created on : 8 de Agosto de 2005, 10:48
Author : gian
Description:
Purpose of the document follows.
-->
<!DOCTYPE hibernate-mapping PUBLIC
'-//Hibernate/Hibernate Mapping DTD//En'
'http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd'>
<hibernate-mapping>
<class name="net.unesc.kiron.uti.map.Paciente"
table="PACIENTE">
<id
name = "codPac"
column = "CODPAC"
type = "java.lang.Integer">
<generator class="sequence"/>
</id>
<property
name = "numeroRegistro"
column = "NUM_REGISTRO"
type = "java.lang.Integer"/>
<property
name = "nome"
column = "NOME"
type = "string"/>
<property
name = "dataNasc"
column = "DATA_NASC"
type = "date"/>
<property
name = "sexo"
column = "SEXO"
type = "java.lang.Character"/>
<property
name = "fone01"
column = "FONE01"
type = "string"/>
<property
name = "fone02"
column = "FONE02"
type = "string"/>
<property
name = "complemento"
column = "COMPLEMENTO"
type = "string"/>
<many-to-one name="endereco" cascade="all" class="net.unesc.kiron.uti.map.Endereco" column="CODPAC" not-null="true" />
</class>
</hibernate-mapping>
this error:
Code:
Exception in thread "main" org.hibernate.MappingException: Repeated column in mapping for entity: net.unesc.kiron.uti.map.Paciente column: CODPAC (should be mapped with insert="false" update="false")