I have a custom type for hibernate (TipoSiNo
), this is the equivalent of the YesNoType
but for spanish (S/N).
When using java I declared this type as the default for boolean fields in a package-info.java file:
@TypeDefs(@TypeDef(name = "si_no", typeClass = TipoSiNo.class, defaultForType = Boolean.class))
package com.xyz;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;
import com...TipoSiNo;
This worked fine for java entity classes but when I convert them to kotlin I got an error:
Data conversion error converting "'S'...
So I supossed I had to convert the package-info file to kotlin:
@file:TypeDefs(TypeDef(name = "si_no", typeClass = TipoSiNo::class, defaultForType = Boolean::class))
package com.xyz
import org.hibernate.annotations.TypeDef
import org.hibernate.annotations.TypeDefs
import com...TipoSiNo
But even then it does not seem to work.