Caused by: org.hibernate.AnnotationException: Illegal attempt to map non-collection to @OneToMany, @ManyToMany or @CollectionOfElements:


Melolo

I have a problem, when I run hibernate it shows me the error "Caused by: org.hibernate.AnnotationException: Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: com.trein.Moneda.documento", the truth is I don't know why it throws this error. seems to fail in Moneda.javaclass

documentation.java

@ManyToOne
@JoinColumn(name = "pais_id", nullable = false)
private Pais pais;

@ManyToOne
@JoinColumn(name = "moneda_id", nullable = false)
private Moneda moneda;

@ManyToOne
@JoinColumn(name = "remesa_id", nullable = false)
private Remesa remesa_doc;

Moneda.java

@OneToMany(mappedBy = "moneda")
private Documento documento;
Missouri

If you expect the Monedaobject to have many Documentoobjects, then you should create it List<Documento>because @OneToManythe annotation expects the property to be a of collectionsome object.

Related


Hibernate illegal attempt to dereference collection

Kamel Mili Hi all I have a spring boot app and I am trying to execute a query but I am getting this error illegal attempt to dereference collection [dev0_."IdDev".vehid] with element property reference [marque] [SELECT DISTINCT d FROM com.ardia.MDValidation.en

Hibernate illegal attempt to dereference collection

Kamel Mili Hi all I have a spring boot app and I am trying to execute a query but I am getting this error illegal attempt to dereference collection [dev0_."IdDev".vehid] with element property reference [marque] [SELECT DISTINCT d FROM com.ardia.MDValidation.en

Hibernate illegal attempt to dereference collection

Kamel Mili Hi all I have a spring boot app and I am trying to execute a query but I am getting this error illegal attempt to dereference collection [dev0_."IdDev".vehid] with element property reference [marque] [SELECT DISTINCT d FROM com.ardia.MDValidation.en

Hibernate illegal attempt to dereference collection

Kamel Mili Hi all I have a spring boot app and I am trying to execute a query but I am getting this error illegal attempt to dereference collection [dev0_."IdDev".vehid] with element property reference [marque] [SELECT DISTINCT d FROM com.ardia.MDValidation.en