I have the following setup
table: table1
| id | name |
| 1 | test |
table: table2
| id | table1_id | value |
| 1 | 1 | ENUM1 |
| 2 | 1 | ENUM2 |
And then, I have the following Java code:
@Entity
public class Table1 {
@Id
@GeneratedValue
private Long id;
@NotEmpty
@Column(unique = true)
private String name;
@OneToMany
@JoinTable(
name = "TABLE2",
joinColumns = @JoinColumn(name = "table1_id")
)
@Enumerated(EnumType.STRING)
private Set<TheEnum> enumValues;
}
But, when I am trying to run my Spring boot app I get the following error:
Caused by: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: ${package}.Table1.enumValues
Do you know what I have to do?