Abstract type for Converted values

I have this jsonb field in my entitiy as follows:

    @Convert(converter = BaseAIPojoConverter.class)
    @Column(name = "OUTPUT_PARAMS", columnDefinition = "jsonb")
    @Lob
    private ComplexPojoType outputParams;

Here is my BaseAIPojoConverter class defination:

@Converter(autoApply = true)
public class BaseAIPojoConverter implements AttributeConverter<ComplexPojoType, PGobject> {
    @Override
    public PGobject convertToDatabaseColumn(ComplexPojoType pojo) {
     // some logic
    }
    @Override
    public ComplexPojoType convertToEntityAttribute(PGobject dbData) {
      // some logic
    }
}

ComplexPojoType class is an abstract:

public abstract class ComplexPojoType implements Serializable {
 // some fields
// some methods
}

one of the concrete class type of ComplexPojoType:

@Getter
@Setter
public class AICVParserPojo extends ComplexPojoType {
// some fields
}

with those configurations above, when I run the application, I face such an exception:

Can't find range class 'ComplexPojoType' for property 'outputParams'

What might be the direct cause of this error?

Hi Otabek,

You need to properly declare a datatype class, e.g.:
ComplexPojoTypeDatatype implements Datatype<ComplexPojoType>
etc.
Jmix cannot recognise your class as a datatype and considers it as an entity, which leads to the error.

You can check out the docs on custom types here:
https://docs.jmix.io/jmix/data-model/data-types.html#custom-type

Also you can look for solution in previous forum topics, for example:

Regards,
Sergey.