Galera nao estou conseguindo fazer o relacionamento Many-to-one O que pode estar errado?
Vai o codigo:
Pais.java
package jcep.model;
public class Pais{
private int id = 0;
private String nome = null;
private String sigla = null;
getts e setters.....
}
Pais.hbm.xml
</class>
Estado.java
package jcep.model;
public class Estado {
private int id = 0;
private String nome = null;
private String sigla = null;
private Pais pais = null;
getters e setters.....
}
Estado.hbm.xml
Applicacao.java
inicio…
estadoDao = ApplicationFactory.getDAOFactory().getEstadoDAO();
pais.setNome("BRASIL");
pais.setSigla("BR");
estado.setNome("PARANA");
estado.setSigla("PR");
estado.setPais(pais);
estadoDao.insert(estado);
fim…
E aparece esta mensage…
2004-11-11 00:32:06,982 INFO hibernate.cfg.Binder -> Mapping class: jcep.model.Estado -> Estado
2004-11-11 00:32:06,982 DEBUG hibernate.cfg.Binder -> Mapped property: id -> estId, type: integer
2004-11-11 00:32:06,982 DEBUG hibernate.cfg.Binder -> Mapped property: nome -> estNome, type: string
2004-11-11 00:32:06,982 DEBUG hibernate.cfg.Binder -> Mapped property: sigla -> estSigla, type: string
2004-11-11 00:32:06,982 DEBUG hibernate.cfg.Binder -> Mapped property: pais -> paiId, type: jcep.model.Pais
2004-11-11 00:32:06,982 INFO hibernate.cfg.Configuration -> processing one-to-many association mappings
2004-11-11 00:32:06,982 INFO hibernate.cfg.Configuration -> processing one-to-one association property references
2004-11-11 00:32:06,982 INFO hibernate.cfg.Configuration -> processing foreign key constraints
2004-11-11 00:32:06,982 DEBUG hibernate.cfg.Configuration -> resolving reference to class: jcep.model.Pais
E não faz nada…
Desde já agradeço
