似乎您无法创建复制构造函数,也无法使其实现可克隆。
我正在考虑使用反射来迭代子类的每个属性,但是有更好的方法吗?
最佳答案
为了复制记录,我使用了 UpdatableRecord.copy()
方法。
/**
* Duplicate this record (in memory) and reset all fields from the primary
* key or main unique key, such that a subsequent call to {@link #store()}
* will result in an <code>INSERT</code> statement.
*
* @return A new record, distinct from <code>this</code> record.
*/
R copy();
关于java - 克隆 jOOQ Record 对象的推荐方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53677584/