added function to select several entities by id, fixed ReferenceList for many to many relations