Someone faced the problem of Ormlite and Gson, Gson cannot work with ForeignCollection. How did you solve this problem?
My class to turn into json
public class Building { @DatabaseField(dataType = DataType.INTEGER, columnName = "id", generatedId = true) private int id; @DatabaseField(dataType = DataType.STRING, columnName = "name") private String address; @ForeignCollectionField(eager = true) private ForeignCollection<Person> persons; } public class Person { @DatabaseField(dataType = DataType.INTEGER, columnName = "id", generatedId = true) private int id; @DatabaseField(dataType = DataType.STRING, columnName = "name") private String name; @DatabaseField (foreign = true, foreignAutoRefresh = true) public Building building; }