Given
@Entity(name = "Delivery")
@Table(name = "Delivery")
public static class Delivery {
@EmbeddedId
private LocationId locationId;
}
@Embeddable
public static class LocationId {
@Column(name = "sp_country")
private String country;
@Column(name = "sp_city")
private String city;
}
the following
s.createQuery( "from Delivery d where d.locationId in ?1" ).setParameter( 1, new LocationId( "Italy", "Verbania" ) ).getResultList()
generates the wtong sql query
select d1_0.sp_city,d1_0.sp_country,d1_0.field from Delivery d1_0 where (d1_0.sp_city,d1_0.sp_country) in (($1,$1))
the in
operator values (($1,$1))
should be in (($1,$2))