Good morning Stackoverflow,
I have the problem that it gives me the error:
Failed to create sessionFactory object.org.hibernate.AnnotationExcept
You can't save your collection fields as Concrete classes.
Got this,
As a requirement persistent collection-valued fields must be declared as an interface type (see Example 7.2, “Collection mapping using @OneToMany and @JoinColumn”). The actual interface might be java.util.Set, java.util.Collection, java.util.List, java.util.Map, java.util.SortedSet, java.util.SortedMap or anything you like ("anything you like" means you will have to write an implementation of org.hibernate.usertype.UserCollectionType).
From Chapter 7. Collection Mapping.
You can use below code to save a sorted set(KINDLY READ THE COMMENTS):
@OneToMany(cascade=CascadeType.ALL) //Removed targetEntity, as you are already using generics.
@JoinColumn(name="team_id") // Use this name as to show the presence of foreign key of EducationTeam in CoachGroup.
@SortNatural // Make sure that your CoachGroup Entity has implemented Comparable interface which wii be used while sorting.
private SortedSet coachGroups = new TreeSet<>();