Primitive List feature(Part7: Schema)#5209
Conversation
…ullable always false against primitive list field.
0fb5ed3 to
afaf891
Compare
| OBJECT("OBJECT", "Object", false), | ||
| LIST("LIST", "List", true), | ||
|
|
||
| BACKLINK("LINKING_OBJECTS", null, true), |
There was a problem hiding this comment.
will this result https://github.com/realm/realm-java/pull/5209/files#diff-36f5b86acab52385e590ad92a6d7a80cR690 add backlink RealmResults as a persisted property?
Would isList() useful for backlinks? maybe change it to isRealmList and return false for backlink if it is not useful for it?
| @@ -1943,7 +1952,16 @@ private Constants.RealmFieldType getRealmType(VariableElement field) { | |||
| return Constants.RealmFieldType.OBJECT; | |||
| } | |||
| if (Utils.isRealmList(field)) { | |||
There was a problem hiding this comment.
it seems Field.isList() is not needed?
| if (table->get_column_type(S(columnIndex)) != type_Table) { | ||
| return to_jbool(table->is_nullable(column_index)); // noexcept | ||
| } | ||
| return to_jbool(table->get_descriptor()->get_subdescriptor(S(columnIndex))->is_nullable(S(0))); // noexcept |
There was a problem hiding this comment.
why ? would not primitive list be always nullable?
There was a problem hiding this comment.
no.
nullable for primitive list means that the list can contain null as value.
So, your change in ff3c205 was not correct.
I'll fix this.
| } | ||
|
|
||
| return static_cast<jint>(TBL(nativeTablePtr)->get_column_type(S(columnIndex))); // noexcept | ||
| auto column_type = TBL(nativeTablePtr)->get_column_type(S(columnIndex)); // noexcept |
There was a problem hiding this comment.
Is Table.getColumnType() used anywhere? I thought we should just delete this.
There was a problem hiding this comment.
We might use it in the Dynamic API. I didn't check though
There was a problem hiding this comment.
Used in MutableRealmObjectSchema at least.
| if (column_type != type_Table) { | ||
| return static_cast<jint>(column_type); | ||
| } | ||
| return static_cast<jint>(ROW(nativeRowPtr)->get_table()->get_descriptor()->get_subdescriptor(S(columnIndex))->get_column_type(S(0)) |
There was a problem hiding this comment.
This sounds hacky ... please add a FIXME here and i will check -- if Object Store changed the enum, we are quite difficult to figure out what is going wrong.
- add FIXME for modified native method. - Code cleanup.
This PR is based on Part 6 (#5208)
This PR implements schema related feature required from proxy class.