I'm using Ormlite plugin on Android to manage my database, I set a class field with foreignAutoRefresh on true because this is the default behavior (normally I wanna to get all the Objects loaded automatically).
@DatabaseTable(tableName = "MyClass")
public class MyClass {
@DatabaseField(columnName = "field",
foreign = true, foreignAutoRefresh = true )
private MyObject field;
...
}
But in a specific rare situation I wanna to load a instance of MyClass without load automatically the Object field (setting the foreignAutoRefresh to false temporally)
How I can do that?
public class DBHelper extends OrmLiteSqliteOpenHelper {
@Override
public void onUpgrade(...) {
// ... here I want to set MyClass.field.autoreRefresh to false.
List<MyClass> myClass = myClassDao.queryForAll();
... do some of work here ...
// ... set again the autoRefresh field value to true.
}
}
Thank you a lot!