added uniqueId method to entitymanager, added sortBy method to entityManager