你如何更新 Ormlite 中的外部字段?

How do you update a foreign field in Ormlite?

我尝试了 update(Object)update(PreparedUpdate)executeRaw(String)updateRaw(String),甚至尝试直接使用助手 class 然后使用 getData(String query) .但是我的table的foreign字段还是没有更新。知道为什么会这样吗?

我发现我在其他方法上使用了 update(Object) 方法,同时传递了我尝试更新的对象的过时实例。因此,一旦我使用实际的 update(PreparedUpdate) 方法,我就会将对象恢复到其原始状态,因为其他方法正在使用 update(outdated Object)