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

Realmlist<String> not able to extract it back #5536

Closed
ayushishah-easternts opened this issue Nov 15, 2017 · 6 comments
Closed

Realmlist<String> not able to extract it back #5536

ayushishah-easternts opened this issue Nov 15, 2017 · 6 comments
Labels

Comments

@ayushishah-easternts
Copy link

ayushishah-easternts commented Nov 15, 2017

Hi,

I am using realm 4.1.1

When trying to use Realmlist in RealmObject we aren't able to retrieve it back

RealmObject data members are as below:

   @PrimaryKey
    private String product_id;
    private String product_name;
    private String specifications_sheet;
    private String brochure;
    private String product_warranty;
    private String product_description;
    private String model;
    private String sku;
    private String upc;
    private String quantity;
    private String image;
    private String manufacturer_id;
    private String manufacturer;
    private String retail_price;
    private String gold_price;
    private String trade_price;
    private String price_currency;
    private String trade_only;
    private String products_type;
    private String category_id;
    private String category_name;
    private String subcategory_id;
    private String subcategory_name;
    private RealmList<String> images = new RealmList<>();`

Here when I am trying to do productDatas.getImages().size() the size is always coming zero

Please let me know where am I going wrong

@cmelchior
Copy link
Contributor

Hard to say without more information.

  • How are you loading data?
  • How do you know that the size has to be different than 0?

@ayushishah-easternts
Copy link
Author

ayushishah-easternts commented Nov 15, 2017

LogClass.e("JSON", jObjProduct.toString()); realm.createOrUpdateObjectFromJson(ProductData.class, jObjProduct);

ProductData productDatas = realm.where(ProductData.class)
                                                            .equalTo(ProductData.Cols.PRODUCT_ID, productId)
                                                            .findFirst();

Using above piece of code to insert data in realm. In which array size is greater than 1

@cmelchior : The json would be coming from server side , hence confirming the array size should be greater than zero

@cmelchior
Copy link
Contributor

Arrays of Primitives are not supported yet by our JSON methods as mentioned in the changelog: https://github.com/realm/realm-java/blob/master/CHANGELOG.md#400-2017-10-16

It is being added in this PR though #5505, so should be in the next minor release.

@ayushishah-easternts
Copy link
Author

@cmelchior Thanks for the prompt response . By when can we expect the minor release ? Should we use workaround as we used for earlier realm version or wait for the release ?

@cmelchior
Copy link
Contributor

Hopefully, we can release next week, but it might change. So that will depend on your timeline. Alternative you can clone that branch and build a version of Realm yourself to include.

@beeender
Copy link
Contributor

beeender commented Nov 16, 2017

this will be released as part of 4.2.0. See #5536

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants