I have a model that has a one-to-many relationship of itself. Every time I run my android application, I keep getting an SQLException
that states that my Foreign Collection class Route
for my field childRoutes
column-name does not contain a foreign field of class Route
. I feel like I specified this already in my Model but I may be missing something?
Here is my model excluding the getters/setters:
public class Route implements Serializable{
@DatabaseField(id = true, canBeNull = false, columnName = "id")
private long id;
@DatabaseField(columnName = "parent", foreign = true)
private Route parent;
@ForeignCollectionField
private ForeignCollection<Route> childRoutes;
}
I followed this question here but I still can't seem to be getting it right. ORMLITE one-to-many recursive relationship