Hello everyone, I am facing issue while creating T...
# troubleshooting
b
Hello everyone, I am facing issue while creating TypeInfoFactory of the below POJO as it has cyclic dependency (i.e POJO instance within the same POJO). Please let me know how I can handle this
Copy code
public class Group {
    private List<Group> groups;
    private String operator;
}
This is what i have tried in TypeInfoFactory and resulting stackoverflow because of cyclic dependency.
Copy code
public TypeInformation<Group> createTypeInfo(Type t, Map<String, TypeInformation<?>> genericParameters) {
        Map<String, TypeInformation<?>> map = new HashMap<>();
        map.put("groups", Types.LIST(Types.POJO(Group.class)));
        map.put("operator", Types.STRING);

        return Types.POJO(Group.class, map);
}