Title: Store Map values as Long instead of Int · Issue #1181 · objectbox/objectbox-java · GitHub
Open Graph Title: Store Map values as Long instead of Int · Issue #1181 · objectbox/objectbox-java
X Title: Store Map values as Long instead of Int · Issue #1181 · objectbox/objectbox-java
Description: Is there an existing issue? I have searched existing issues Use case I am storing a mapping: val mapping = mutableMapOf( "key1" to mutableMapOf( "subkey1" to 1L, "subkey2" to 1L, "subkey3" to 1L ), "key2" to 1L that is represented in the...
Open Graph Description: Is there an existing issue? I have searched existing issues Use case I am storing a mapping: val mapping = mutableMapOf( "key1" to mutableMapOf( "subkey1" to 1L, "subkey2" to 1L, "subkey3" to 1L ),...
X Description: Is there an existing issue? I have searched existing issues Use case I am storing a mapping: val mapping = mutableMapOf( "key1" to mutableMapOf( "subkey1" to 1L, "subkey2&q...
Opengraph URL: https://github.com/objectbox/objectbox-java/issues/1181
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Store Map values as Long instead of Int","articleBody":"\u003c!--\r\n\r\nIf you are looking for support, please check out our documentation:\r\n- https://docs.objectbox.io\r\n- https://docs.objectbox.io/faq\r\n- https://docs.objectbox.io/troubleshooting\r\n\r\n--\u003e\r\n\r\n### Is there an existing issue?\r\n\r\n- [x] I have searched [existing issues](https://github.com/objectbox/objectbox-java/issues)\r\n\r\n### Use case\r\n\r\nI am storing a mapping:\r\n\r\n```kotlin\r\nval mapping = mutableMapOf(\r\n \"key1\" to mutableMapOf(\r\n \"subkey1\" to 1L,\r\n \"subkey2\" to 1L,\r\n \"subkey3\" to 1L\r\n ),\r\n \"key2\" to 1L\r\n```\r\n\r\nthat is represented in the `data class` as follows:\r\n\r\n```kotlin\r\n@Entity\r\ndata class MyDataClass(\r\n @Id var id: Long = 0,\r\n var mapping: MutableMap\u003cString, Any\u003e? = null\r\n```\r\n\r\nObjectBox will store the Long values as Ints due to not being wide enough. These breaks use cases where we **do want** to store the Long values as Long and not as Ints (for example test cases that use the same generated mock data to store in the database and to test against).\r\n\r\n### Proposed solution\r\n\r\nHave an annotation that tells ObjectBox to store Long values as Long.\r\n\r\n### Alternatives\r\n\r\nTried using a `PropertyConverter` however this breaks for the mapping I've provided.\r\n\r\n### Additional context\r\n\r\nKotlin\r\nAndroid\r\n","author":{"url":"https://github.com/alghe-global","@type":"Person","name":"alghe-global"},"datePublished":"2024-07-02T07:06:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/1181/objectbox-java/issues/1181"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ebfd68aa-45bc-390a-fcc1-10cebf24a24d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 930A:22BD94:1DF85C9:2698B88:697FCA29 |
| html-safe-nonce | da246ab46c939506c9a402cfdeea5bddd3cc481ec2fd81ce1d2a6be98800a1cd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzBBOjIyQkQ5NDoxREY4NUM5OjI2OThCODg6Njk3RkNBMjkiLCJ2aXNpdG9yX2lkIjoiMjAzMTQ3NzQ4OTM0MzEyMTk2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7e980454c0ddd8f86907616ad0bf722997ae8abd17202827ed5236934e58180b |
| hovercard-subject-tag | issue:2385416061 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/objectbox/objectbox-java/1181/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b9612033a819839d4197d8ba715edfae207cfc041383a174188fdcf4562fc565/objectbox/objectbox-java/issues/1181 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b9612033a819839d4197d8ba715edfae207cfc041383a174188fdcf4562fc565/objectbox/objectbox-java/issues/1181 |
| og:image:alt | Is there an existing issue? I have searched existing issues Use case I am storing a mapping: val mapping = mutableMapOf( "key1" to mutableMapOf( "subkey1" to 1L, "subkey2" to 1L, "subkey3" to 1L ),... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alghe-global |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/objectbox/objectbox-java git https://github.com/objectbox/objectbox-java.git |
| octolytics-dimension-user_id | 22327943 |
| octolytics-dimension-user_login | objectbox |
| octolytics-dimension-repository_id | 79901405 |
| octolytics-dimension-repository_nwo | objectbox/objectbox-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 79901405 |
| octolytics-dimension-repository_network_root_nwo | objectbox/objectbox-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width