I'm working with android and ormlite. I have a problem to initialize a ForeignCollection
.
I found this, to initialize it: dao.getEmptyForeignCollection()
But for the dao, i need the DatabaseHelper
, and for the databasehelper i need the applicationContext, but in the entity i haven't a context. is there any other option?
And this is the Code, its an 1:n relation. Class Team:
@DatabaseField(canBeNull = true, foreign = true)
private Club club;
Class Club:
@DatabaseField(canBeNull = true, foreign = true)
private ForeignCollection<Team> teams;
Thanks for help