P E N C I L
Login
Composite key: Embeddable
class B { 
    @EmbededId    private EmpPk pk; 
    @Embedable     public static class EmpPk {
        private String id1, id2;
    }
}