optimized method to get a set of entities by PK