Friday 4 November 2011

Hibernate error: org.hibernate.MappingException: Could not determine type for: java.util.List

solution: move JPA annotations to getters and remove them from fields
eg (wrong):
@OneToMany
private List foos;
public List getFoos() { return foos; }
public void setFoos(List foos) { this.foos = foos; }

eg (right):
private List foos;
@OneToMany
public List getFoos() { return foos; }
public void setFoos(List foos) { this.foos = foos; }

1 comment:

  1. Great.

    This solve the problem I have.
    Thank you very much for this solution.

    ReplyDelete