Pessoal, estou tentando colocar o relacionamento na minha classe e esta dando o seguinte erro:
aused by: org.hibernate.AnnotationException: Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: modelo.Analise.metodo
at org.hibernate.cfg.annotations.CollectionBinder.getCollectionBinder(CollectionBinder.java:264)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1455)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:754)
Alguem pode me ajudar por favor ?
package modelo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@Entity
@Table(name="analise")
public class Analise {
@Id
@GeneratedValue
private Integer id;
@OneToMany
@JoinColumn(name = "metodo_id")
private Metodo metodo;
private Integer Resultado;
private Float preco;
}
package modelo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="metodo")
public class Metodo {
@Id
@GeneratedValue
private Integer id;
private String nome;
}