First option is simple & best.
class Team{
List<Employee> members;
}
You can set a batch-size in Hibernate, or many other JPA implementations, so that when the Employees do have to be fetched they are fetched 10 at a time or somesuch. This takes little time to fetch, and Hibernate won't fetch a collection until you require it.
The "set of IDs" doesn't help -- it doesn't provide names of team-members, and it doesn't make loading any faster when you do need them.
The general rule is, don't optimize until you need to.
But there are two alternatives you can consider, if you need to:
- Turn on EH-Cache or similar second-level cache for Team.members and Employee;
- Store an aggregate "team member names" property in Team. Notes: This would have only limited guarantees of up-to-dateness, and has to be to truncated to avoid overflowing it's maximum column-size.
But as an 'indicative display text', rather than an authoritative value, the second option would be fine.