How do you update a foreign field in Ormlite?

2019-08-14 02:58发布

问题:

I tried update(Object), update(PreparedUpdate), executeRaw(String), updateRaw(String), and even tried directly using the helper class then using getData(String query). But my table's foreign field is still not updated. Any thoughts why this is happening?

回答1:

I found out that I am using the method update(Object) on other methods while passing an outdated instance of the object I am trying to update. So once I use the actual update(PreparedUpdate) method, I am reverting the object back to its original state as some other method is using update(outdated Object)