Open Shahjahan786 opened 6 years ago
Any chance the 2nd lookup is in another savePoint started before the delete was called? I assume no one else is creating one of these? Once the delete is called, is the lookup that initially shows no results being called inside of the same savePoint or outside of it?
I got the same problem in my project.
Version: com.j256.ormlite:ormlite-android:5.1
I am just calling this method:
mSomeDao.getDao(aContext).delete(t);
't' is a Collection
And just happens with this object that is annotated with
@ForeignCollectionField(eager = true)
public abstract class MyAbstractClass {
@ForeignCollectionField(eager = true)
private Collection<MyChildClass> myChildClassCollection;
}
public class MyChildClass {
@DatabaseField(
foreign = true,
foreignAutoRefresh = true,
columnName = MY_ABSTRACT_CLASS_ID,
maxForeignAutoRefreshLevel = 0
)
private transient MyAbstractClass myAbstractClass;
}
Everything is going right when I use create method, but, when I try to use delete methods (delete(Collection), DeleteBuilder.delete()), doesn't work.
Hey, my algorithm on Job that deletes from database was wrong. I fixed. I was ignoring some rows because of my DeleteBuilder. My mistake. Everthing is ok!
Code snippets:
Object Class