Merged
Conversation
9b957c3 to
c8a8821
Compare
* Nullability changes for Primitive List support * more @nullable annotations * fix annotation order * Primitive List feature(Part3: Temporary fix of implementations and tests) (#5151) * solve compilation errors related to Primitive List API changes * revert test * fix FB warnings * fix failing tests * Primitive List feature(Part4: Tests) (#5152) * Add Primitive List fields to test classes * removed tests for Primitive List for now * removed tests for Primitive List for now * Primitive List feature(Part5: Element type check in annotation processor) (#5168) * @NotNull as alias for @required (#5161) This PR adds support for org.jetbrains.annotations.NotNull as an alias for @required. This means that Realm now understands the Kotlin type-system in the Realm schema. Previously we reported an error if you did @required RealmList<MyType> list = new RealmList<>();. It is a bit unclear why, since a RealmList is always non-null on managed objects. Since it made the interop with Kotlin kinda strange, I made a change so you can now do @required RealmList<MyType> list = new RealmLis<>() as well as val list : RealmList<MyType> = RealmList(); After this change it is no longer possible to do val person : Person either, you have to do val person : Person?. This reflects the constraints of Realm, but if people are able to maintain the variant themselves (hint: not possible when using sync), then they can use a custom non-null getter. * implement elemenrt type check of RealmList * fix error message * remove extra line * fix typo * address review comments
Contributor
Author
|
I've merged Part 1 to Part 5 into this PR. |
…4_fix_shared_ptr_bug
* generate getters and setters for primitive list * empty commit for part9 * implement logic for primitive list in RealmList * fix tests * fix annotation processor unit tests * throw an exception if query or aggregation feature is used for primitive list * fix tests * address findbugs issues * added Javadoc comment and RealmList.toArray() * fix bug * implement Primitive List logic for copy() and insert() * implement Primitive List logic for insert(Realm, Iterator,...) * generate code for primitive list in update(), insertOrUpdate() * minor refactoring * implement primitive list supprt for copyFromRealm() * added a test to get field meta data of primitive lists * fix test * fix #5233 * move ManagedListOperator classes from the inside of RealmList to outside * Implement special handling for byte[] in RealmList * avoid unnecessary looping * use fqcn when makeing a string of value type. * fix RealmList.toString() * fix a bug * fix bugs * add instrumentation tests * fix a bug that annotation processor always generates schema of primitive list as nullable * fix implementation of RealmList.remove(Object) * fix RealmListTests * fix RealmListTests * added tests for 'copyToRealm()' and 'copyFromRealm()' * added tests for non-null primitive list * fix test * use OsObjectSchemaInfo.addPersistedValueListProperty() * fix test * introduce Row.getModelList() and Row.getValueList() to check field type more precisely * update test case to expose an issue * address review feedback * add notice to Realm.*Json*() * simplify Proxy's createDetachedCopy() * stop to add backlink field into nullable field list * add comments to ClassMetaData.hasRequiredAnnotation() and ClassMetaData.isRequiredField() * move Utils.getRealmListElementTypeMirror() to TypeMirrors class. * fix exception message * add class comment to TypeMirrors * add TODO comment * remove outdate comment * fix todo comment * fix failing test * remove methods to return primitive array * Using constans defined in Table class * use assertArrayEquals() instead of assertTrue(Arrays.equals()) * add changelog entry about removed methods * remove unused code * update comment * remove comment * update exception message * update thrown.expectMessage() to check exception message * fix test case name * add assertion for remove/removeAll * update RealmList.toString() * update exception message * fix failing tests * remove special handling to byte array in RealmList * remove special type conversion via Number in toArray() * remove unnecessary index checks * refactor ManagedListOperator and its sub-classes * use thrown.expectMessage() * add Javadoc comments to ManagedListOperator and its subclasses * address review comments
…tr_bug Primitive List feature(Part14: bug fix (custom deleter for shared_ptr<char>))
…OsList Primitive List feature(Part 13, Support listener on OsList)
Conflicts: realm/realm-library/src/androidTest/java/io/realm/RealmSchemaTests.java realm/realm-library/src/main/java/io/realm/RealmList.java
Zhuinden
reviewed
Sep 26, 2017
…n the elements are not RealmModel) (#5336) * disable RealmList.createSnapshot() * add changelog entry of primitive list * fix CHANGELOG.md * fix CHANGELOG.md * update CHANGELOG.md
3 tasks
This was referenced Oct 1, 2017
|
Great relief. Updating my code base to add Primitive support. |
Contributor
|
@VenomVendor Keep in mind that queries are not supported in the initial release, but we will add them as soon as possible |
Contributor
|
@cmelchior and same for migration support for adding/removing RealmList of primitives to existing schema |
|
How to use? It doesn't compile if I just use RealmList. |
Contributor
|
@jonathansds |
|
It doesn't compile when I use RealmList < Long > |
|
It says that "Long" doesn't extends RealmObject |
Contributor
|
@jonathansds are you using |
|
That was it! Sorry, missed that. |
|
So this is very nice but it's limited to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements #4165 and fixes #575.
TODO:
Required:
RealmList<RealmModel>toRealmList<Object>(@zaki50) Primitive List feature(Part1: API changes) #5145RealmResults<RealmModel>toRealmResults<Object>(@zaki50) Primitive List feature(Part1: API changes) #5145RealmList(Java side, @zaki50) Primitive List feature(Part 9, RealmList) #5213 (part 9)createSnapshot()) (@zaki50) Primitive List feature(Part15: Disable RealmList.createSnapshot() when the elements are not RealmModel) #5336 (part 15)Optional/In prioritized order:
copyToRealm/copyOrUpdate(@zaki50) Primitive List feature(Part8: Annotation processor implementation) #5210 (part 8)insert/insertOrUpdate(@zaki50) Primitive List feature(Part8: Annotation processor implementation) #5210 (part 8)copyFromRealm(@zaki50) Primitive List feature(Part8: Annotation processor implementation) #5210 (part 8)RealmObjectSchema) (@cmelchior) Array of Primitives: RealmObjectSchema support #5329OrderedRealmCollectionImpl,OrderedRealmCollectionSnapshot(@zaki50) Primitive List feature(Part 11, Collection, Snapshot) #5220 (part11)RealmResults(@zaki50) Primitive List feature(Part 11, Collection, Snapshot) #5220 (part11)