class YNStringToBooleanMapper implements TypeMapper<String, Boolean> {

    @Override
    public String getLabel() {
        return "Y/N to Boolean";
    }
    
    @Override
    public Type getJavaType(Column column) {
        if (column.isNullable()) {
            return Boolean.class;
        } else {
            return boolean.class;
        }
    }

    @Override
    public Boolean toJavaType(Column column, Class<?> entityType, String value) {
        return value == null ? null : value.equalsIgnoreCase("Y");
    }

    @Override
    public String toDatabaseType(Boolean value) {<FILL_FUNCTION_BODY>}
}

        if (value == null) {
            return null;
        } else {
            return value ? "Y" : "N";
        }
    
<no_super_class>