Thursday, 25 June 2015

Transient and still getting the error "MappingException: Could not determine type"

So I have a POJO with a field annotated as @Transient as in

private Workbook workbook;
    public Workbook getWorkbook() {
        return workbook;
    public void setWorkbook(Workbook workbook) {
        this.workbook = workbook;

But I am still getting the error:

Caused by: org.hibernate.MappingException: Could not determine type for:,

Solution: Check your import for @Transient.

If you are using 'import java.beans.Transient;' then you have the wrong one.

It wants to be 'import javax.persistence.Transient'

It looks like this error depends on the type of object you are making transient. If the object is String then it does not complain. In my case I had a poi Workbook class.