bilal
bilal

Reputation: 725

hibernate PropertyNotFoundException

I already found some information about this exception but mine is very strange.

Caused by: org.hibernate.PropertyNotFoundException: 
Could not find a setter for property empty in class java.util.List

There is no information where is the failure. I use List in my entities but I don't understand where is the failure.

Upvotes: 2

Views: 1867

Answers (2)

bilal
bilal

Reputation: 725

I got it. I use this embedded collection in a super class and override its getter setter in subclass. The problem was, i had @ElementCollection annotation just in subclass. When i wrote it to superclass, the problem was solved. thanks for your responses.

Upvotes: 0

Speck
Speck

Reputation: 2299

Hibernate is trying to persist a List object and telling you there is no setEmpty(boolean empty) method on List.

This is caused by a configuration problem trying to create a relationship between two entities.

Update:

setEmpty is not needed. The way you've configured your collection on the hibernate entity is confusing Hibernate into trying to persist a List instead of creating a relationship between rows in two tables. You need to correctly configure the one-to-many relationship in question.

Upvotes: 1

Related Questions