I'm trying to perform a composite key query using @embeddable.
Here's what I have thus far.
@Embeddable
public class IfasvVendorPK implements Serializable{
@Column(length = 4, nullable = false)
protected String peId;
@Column(length = 8, nullable = false)
protected String peAddrCd;
Entity
@Entity
public class IfasvVendor implements Serializable {
@EmbeddedId
private IfasvVendorPK ifasvVendorPK;
Query
List contains two pks. Not sure if I should be using a list for this.
Query query = session.createQuery("from IfasvVendor t0 where t0.ifasvVendorPK.peId=:id");
query.setParameter("id", list);
query.list();
I also wasn't sure how to get the object once I get the query working.
from IfasvVendor t0 where t0.ifasvVendorPK.peId in :idListandquery.setParameter("idList", list).