Oi galera,
Estou trabalhado com Hibernate e esta me dando a seguinte mensagem de erro quado eu tento: “from Materia”
Exception in thread “main” net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of br.com.revista50emais.materia.Olho.setCd_materia
Minhas classe:
public class Materia {
private Integer cd_materia;
private Integer cd_secao;
private Integer cd_edicao;
private String ds_autor;
private String imagem_home;
private Corpo corpo;
private List olhos;
private List fotos;
private List boxs;
private List perguntas;
/** @hibernate.property length=“200”<em>/
public String getDs_autor() {
return ds_autor;
}
public void setDs_autor(String ds_autor) {
this.ds_autor = ds_autor;
}
/** @hibernate.property length=“100”</em>/
public String getImagem_home() {
return imagem_home;
}
public void setImagem_home(String imagem_home) {
this.imagem_home = imagem_home;
}
/** @hibernate.id generator-class=“native” <em>/
public Integer getCd_materia() {
return cd_materia;
}
public void setCd_materia(Integer cd_materia) {
this.cd_materia = cd_materia;
}
/</em>* @hibernate.one-to-one cascade=“all” <em>/
public Corpo getCorpo() {
return corpo;
}
public void setCorpo(Corpo corpo) {
this.corpo = corpo;
}
/</em>* @hibernate.property <em>/
public Integer getCd_edicao() {
return cd_edicao;
}
public void setCd_edicao(Integer cd_edicao) {
this.cd_edicao = cd_edicao;
}
/</em>* @hibernate.property <em>/
public Integer getCd_secao() {
return cd_secao;
}
public void setCd_secao(Integer cd_secao) {
this.cd_secao = cd_secao;
}
/</em>* @hibernate.bag name=“boxs” cascade=“save-update” inverse="true’
- @hibernate.collection-key column=“Cd_Materia”
- @hibernate.collection-one-to-many class=“br.com.revista50emais.materia.Box”
-
/
public List getBoxs() {
return boxs;
}
public void setBoxs(List boxs) {
this.boxs = boxs;
}
/* @hibernate.bag name=“fotos” cascade=“save-update” inverse="true’ - @hibernate.collection-key column=“Cd_Materia”
- @hibernate.collection-one-to-many class=“br.com.revista50emais.materia.Foto”
-
/
public List getFotos() {
return fotos;
}
public void setFotos(List fotos) {
this.fotos = fotos;
}
/* @hibernate.bag name=“olhos” cascade=“save-update” inverse="true’ - @hibernate.collection-key column=“Cd_Materia”
- @hibernate.collection-one-to-many class=“br.com.revista50emais.materia.Olho”
-
/
public List getOlhos() {
return olhos;
}
public void setOlhos(List olhos) {
this.olhos = olhos;
}
/* @hibernate.bag name=“perguntas” cascade=“save-update” inverse="true’ - @hibernate.collection-key column=“Cd_Materia”
- @hibernate.collection-one-to-many class=“br.com.revista50emais.materia.Pergunta”
- */
public List getPerguntas() {
return perguntas;
}
public void setPerguntas(List perguntas) {
this.perguntas = perguntas;
}
}
public class Olho {
private Integer cd_materia;
private Integer cd_olho;
private String ds_olho;
/** @hibernate.id generator-class=“native” <em>/
public Integer getCd_olho() {
return cd_olho;
}
public void setCd_olho(Integer cd_olho) {
this.cd_olho = cd_olho;
}
/</em>* @hibernate.many-to-one column=“Cd_Materia” class=“br.com.revista50emais.materia.Materia” <em>/
public Integer getCd_materia() {
return cd_materia;
}
public void setCd_materia(Integer cd_materia) {
this.cd_materia = cd_materia;
}
/</em>* @hibernate.property */
public String getDs_olho() {
return ds_olho;
}
public void setDs_olho(String ds_olho) {
this.ds_olho = ds_olho;
}
}
Já procurei na internet, e segui algumas dicas como mudar o tipo de campo de int para Integer, mas continuou dando o mesmo erro.
[]s