I’m learning HQL and I’ve an object with a Map property like this:
@ElementCollection
@JoinTable(name = "InfoLicenzaOrdine", joinColumns = @JoinColumn(name = "infolicenza"))
@Column(length = 64000)
public Map<String, String> getInformazioniDiLicenza() {
return informazioniDiLicenza;
}
public void setInformazioniDiLicenza(
Map<String, String> informazioniDiLicenza) {
this.informazioniDiLicenza = informazioniDiLicenza;
}
Now an HQL query like:
select ordine from Ordine ordine where ordine.informazioniDiLicenza['codiceAccisa1'] = 'IT00NOV00029W'
will return all the objects with that value for that particular key of the map. What if I just want all the objects with that value regardless of the key?
See also: