You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def productToDocument(cc:Product)
...
val values = cc.productIterator
val fieldList = cc.getClass.getDeclaredFields.toList
...
val purifiedFromId = values.zip(fieldList.iterator).toList.filter { case (v, f) => !isId(f.getName, cc.getClass) }
values and fieldList are not guaranteed to be the same length. Some values may be saved with incorrect field names.
For example:
class TraceElement3( val date: Int )
case class LoginEvent3(val userID: Int)
case class TraceElementLoginEvent3( override val date: Int, val xx:String, val data: LoginEvent3 ) extends TraceElement3(date)
... the overridden value is hidden from the field list (two fields, three values).
Since loading matches fields to the document by case constructor's parameters, one solution to this is to look at the constructor's parameter list fieldList (and their annotations). This would also ensure reading and writing use the same policy to identify fields).
Am working on a fix for this.
The text was updated successfully, but these errors were encountered:
values and fieldList are not guaranteed to be the same length. Some values may be saved with incorrect field names.
For example:
... the overridden value is hidden from the field list (two fields, three values).
Since loading matches fields to the document by case constructor's parameters, one solution to this is to look at the constructor's parameter list fieldList (and their annotations). This would also ensure reading and writing use the same policy to identify fields).
Am working on a fix for this.
The text was updated successfully, but these errors were encountered: