Added method to find entity or it's sub-type by primary key