How to write JPQL SELECT with embedded id?
问题 I'm using Toplink essentials (JPA) + GlassFish v3 + NetBean 6.9 I have one table with composite primary key: table (machine) ---------------- |PK machineId | |PK workId | | | |______________| I created 2 entity classes one for entity itself and second is PK class. public class Machine { @EmbeddedId protected MachinePK machinePK; //getter setters of fields.. } public class MachinePK { @Column(name = "machineId") private String machineId; @Column(name = "workId") private String workId; } Now..