Schema independent plugin insert operation for a traditional single Row & more advanc...
[ovsdb.git] / library / src / main / java / org / opendaylight / ovsdb / lib / schema / BaseType.java
index be9149f3a2cdebca5882e8017045677dc5fe72ba..070de83249ff8347e7a48f08e9b8353ffa6bb4c2 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.ovsdb.lib.schema;
 import java.util.Set;
 
 import org.opendaylight.ovsdb.lib.error.TyperException;
+import org.opendaylight.ovsdb.lib.notation.ReferencedRow;
 import org.opendaylight.ovsdb.lib.notation.UUID;
 
 import com.fasterxml.jackson.databind.JsonNode;
@@ -478,6 +479,14 @@ public abstract class BaseType<E extends BaseType<E>> {
                         return new UUID(value.get(1).asText());
                     }
                 }
+            } else {
+                /*
+                 * UUIDBaseType used by RefTable from SouthBound will always be an Array of ["uuid", <uuid>].
+                 * But there are some cases from northbound where the RefTable type can be expanded to a Row
+                 * with contents. In those scenarios, just retain the content and return a ReferencedRow for
+                 * the upper layer functions to process it.
+                 */
+                return new ReferencedRow(refTable, value);
             }
             return null;
         }