public override bool IsAbleToStore(object value) { bool canStore = false; if (value is IList <object> list) { if (list.Count > 0) { // We can only store the list if we are sure it's actually a // list of JPA entities. In case the // list is empty, we don't store it. canStore = true; Type entityClass = mappings.GetEntityMetaData(list[0].GetType()).EntityClass; foreach (object entity in list) { canStore = entity != null && mappings.IsJPAEntity(entity) && mappings.GetEntityMetaData(entity.GetType()).EntityClass.Equals(entityClass); if (!canStore) { // In case the object is not a JPA entity or the class // doesn't match, we can't store the list break; } } } } return(canStore); }
public override bool IsAbleToStore(object value) { if (value == null) { return(true); } return(mappings.IsJPAEntity(value)); }