Skip to content
Advertisement

AnnotationException: A Foreign key refering has the wrong number of column. should be 0

What is the reason this error in Hibernate?

This is my class which has a foreign key named ogrenciId from Ogrenciler.class

This is my child class

This my base class

I dont know what is the problem please can you help me?

Advertisement

Answer

I solved the problem maybe helps you.

I added referencedColumnName = "ID" to @JoinColumn annotation this helped me.

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