Journal model: call the postLoad callback on fetch too.

It's really annoying that it doesn't do it automatically as it should,
in the meanwhile, add this workaround.

I reported it to upstream:
https://github.com/requery/requery/issues/487
pull/5/head
Tom Hacohen 7 years ago
parent 415d5d5447
commit 0cd57851ad

@ -65,7 +65,12 @@ public class JournalModel {
}
public static JournalEntity fetch(EntityDataStore<Persistable> data, String url) {
return data.select(JournalEntity.class).where(JournalEntity.UID.eq(url)).limit(1).get().firstOrNull();
JournalEntity ret = data.select(JournalEntity.class).where(JournalEntity.UID.eq(url)).limit(1).get().firstOrNull();
if (ret != null) {
// FIXME: For some reason this isn't always being called, manually do it here.
ret.afterLoad();
}
return ret;
}
public static JournalEntity fetchOrCreate(EntityDataStore<Persistable> data, CollectionInfo collection) {

Loading…
Cancel
Save