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
// Throw if model contains a dictionary field until we add support for it
1716
-
if (containsDictionary(metadata.fields)) {
1717
-
emitStatement("throw new UnsupportedOperationException(\"Calls to 'insertOrUpdate' with RealmModels containing RealmDictionary properties are not supported yet.\")")
1718
-
endMethod()
1719
-
emitEmptyLine()
1720
-
return@apply
1721
-
}
1722
-
1723
1715
// Throw if model contains a set field until we add support for it
1724
1716
if (containsSet(metadata.fields)) {
1725
1717
emitStatement("throw new UnsupportedOperationException(\"Calls to 'insertOrUpdate' with RealmModels containing RealmSet properties are not supported yet.\")")
@@ -1862,9 +1854,69 @@ class RealmProxyClassGenerator(private val processingEnvironment: ProcessingEnvi
1862
1854
endControlFlow()
1863
1855
endControlFlow()
1864
1856
endControlFlow()
1865
-
} elseif (Utils.isRealmDictionary(field)) {
1866
-
// TODO: dictionary
1867
-
emitSingleLineComment("TODO: Dictionary")
1857
+
} elseif (Utils.isRealmModelDictionary(field)) {
1858
+
val genericType:QualifiedClassName=Utils.getGenericTypeQualifiedName(field)!!
1859
+
val dictElementType:TypeMirror=Utils.getGenericType(field)!!
1860
+
val isEmbedded =Utils.isFieldTypeEmbedded(dictElementType, classCollection)
1861
+
val linkedProxyClass:SimpleClassName=Utils.getDictionaryGenericProxyClassSimpleName(field)
emitStatement("""throw new IllegalArgumentException("Embedded objects can only have one parent pointing to them. This object was already copied, so another object is pointing to it: cache${fieldName}.toString()")""")
0 commit comments