Skip to content
Advertisement

Can’t create one_to_one relationship: Unknown mappedBy in

I try to create an OneToOne relationship between two tables but I receive errors.

I used a lot of tutorials but nothing helps. For example baeldung tutorial:

Project structure:

JavaScript

The error:

JavaScript

Gradle:

JavaScript

application.properties:

JavaScript

Advertisement

Answer

You need to use a field name for mappedby, not a column name.

In you case, it should be @OneToOne(mappedBy = "personalData").

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement