This mapping Entity-Basic used to work perfectly in older versions. But it throw exception after updating to latest versions of Eclipselink.
@ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name="modulos_modelos_bases", joinColumns=@JoinColumn(name="modelo"))
@Column(name="cantidad")
@MapKeyJoinColumn(name="modulo", referencedColumnName="id")
protected Map<TipoModulo,Integer> modulos;
Now, I'm getting this exception in execution time:
[EL Warning]: 2021-08-27 17:16:17.13--ServerSession(220937316)--Exception [EclipseLink-6157] (Eclipse Persistence Services - 3.0.2-RC2.v202107120925): org.eclipse.persistence.exceptions.QueryException
Exception Description: Element [4] is being added to a map without a key. This generally means the database does not hold a key that is expected.
Query: DataReadQuery(name="modulos" sql="SELECT t0.cantidad, t0.modulo FROM modulos_modelos_bases t0 WHERE (t0.modelo = ?)")
Its being working for years. Database hasnt being modified either.
Could this be a bug? Has the JPA implementation changed?
Thanks in advance
[Updated on: Fri, 27 August 2021 15:36]
Report message to a moderator