I have a JPA entity called Parent and inside that there is embeddedPrimary key as Child
@Entity
@Table(name = "PARENT")
@NamedQuery(?????)
public class Parent implements Serializable {
@EmbeddedId
private ChildPK child;
}
and
@Embeddable
public class ChildPK implements Serializable {
@Column(name = "DEALERID")
private String dealerId;
@Column(name = "BRANDID")
private Long brandId;
..
}
How can I write named Query in Parent class so that i can perform select on dealerId and brandId from ChildPk.