Hello, I have a model following below.
My Java code is
Code:
public class People implements Serializable {
private int id;
private String nome;
private String telefone;
private String endereco;
private java.util.List telefones;
private Dep departamento;
getters and setters for all fiels.
//
public class Phone implements Serializable {
private People pessoa;
private TP_Phone tipoTelefone;
private int ddd;
private String numero;
public class Dep implements Serializable {
private int codigo;
private String nome;
public class TP_Phone implements Serializable{
private int codigo;
private String nome;
How can I map these code ? Because the hibernate throw an Exception
"Caused by: net.sf.hibernate.MappingException: Foreign key (telefone [cod_pessoa])) must have same number of columns as the referenced primary key (pessoa [cod_depart,codigo])"
Thank very much!!!