Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLIBZ-2647 Self-reference data model with an array #203

Conversation

@yuliya-guseva
Copy link
Contributor

commented Nov 6, 2018

Description

The goal of the task is to find why the SDK throws the exception after getting saved entity, which has an array with self-reference type in entity data model.

Changes

Fix the condition in ClassHash.createSchemeFromClass

Tests

Instrumented

feat:
MLIBZ-2647 Self-reference data model with an array
@@ -380,7 +380,7 @@ private static RealmObjectSchema createSchemeFromClass(String name, DynamicRealm
if (fieldInfo == null){
continue;
}
if (fieldInfo.getType().isArray() || Collection.class.isAssignableFrom(fieldInfo.getType())){

This comment has been minimized.

Copy link
@vinaygahlawat

vinaygahlawat Nov 8, 2018

Contributor

@yuliya-guseva Can you explain more why this condition was causing an exception?

This comment has been minimized.

Copy link
@yuliya-guseva

yuliya-guseva Nov 13, 2018

Author Contributor

This class works with Realm tables and contains a complicated logic.
This part of the condition was logically incorrect because we go into this part of the code only if the field is an array and the type of the array inherits GenericJson. In this case, the RealmObjectSchema.addRealmListField method is called and the field is created in the table in the form of ArrayList. But for the array this method should not be called.

@yuliya-guseva yuliya-guseva merged commit e0b063c into indev Nov 15, 2018

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details

@yuliya-guseva yuliya-guseva deleted the feature/MLIBZ-2647_Self-reference_data_model_with_an_array branch Nov 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.