我正在使用android和ormlite。我有一个初始化ForeignCollection
的问题。我在哪里可以找到初始化ORMLite所需的ApplicationContext?
我发现这一点,将其初始化:dao.getEmptyForeignCollection()
但对于道,我需要的DatabaseHelper
,并为databasehelper我需要一个ApplicationContext,但在实体我有没有背景。有没有其他的选择?
这是Code,它是1:n的关系。一流的团队:
@DatabaseField(canBeNull = true, foreign = true)
private Club club;
类俱乐部:
@DatabaseField(canBeNull = true, foreign = true)
private ForeignCollection<Team> teams;
感谢您的帮助
你的意思是这样的[链接](http://stackoverflow.com/questions/987072/using-application-context-everywhere)。 或更多类似这样的内容 'public Club(Context context,String name){ \t this.name = name; }' – Flow 2012-04-11 11:05:30
正是那:)快乐编码。 – Snicolas 2012-04-11 11:06:03
感谢您的帮助 – Flow 2012-04-11 11:11:17