thanks a lot but i have this problem:
Class Municipio
Code:
@Table(name = "MUNICIPIOS")
@Entity
@IdClass(MunicipioPK.class)
public class Municipio ...{
...
@Id
@Column(name = "PROVINCIA" , nullable = false )
public java.math.BigDecimal getProvincia() {
return provincia;
}
@Id
@Column(name = "MUNICIPIO" , nullable = false )
public java.math.BigDecimal getMunicipio() {
return municipio;
}
}
Class MunicipioPKCode:
//imports...
@Embeddable
public class MunicipioPK {
public java.math.BigDecimal provincia;
public java.math.BigDecimal municipio;
@Id
public java.math.BigDecimal getProvincia() {
return provincia;
}
@Id
public java.math.BigDecimal getMunicipio() {
return municipio;
}
//setters included
}
Then, i get this error:
Quote:
FATAL HibernateSessionHelper - Error while configuring the hibernate beans
org.hibernate.AnnotationException: entity.municipiopk.MunicipioPK has not persistent id property
I have added MunicipioPK to config file. :(
Thanks again!
EDIT:
I use hibernate 3.1.2. and hibernate annotations 3.1b8.
EDIT2:
I have not redefined hashcode() and equals() in Municipio and MunicipioPK class. it´s necesary?