Status Update
Comments
yb...@google.com <yb...@google.com> #2
This is probably happening because there are multiple instances of DataStore active. You should consider managing the DataStore as a singleton. See the attached bug for more info.
lu...@gmail.com <lu...@gmail.com> #3
I see. In general, @Embedded is a solution for many cases, but not when the
entity management is done separately.
When we have just a Person attached to an Invoice, to represent the
consumer, for instance, we can't just embed it when the management of the
Person entity is done in another context. Using @Embedded in this scenario
implies that we would need to update all Invoice records where some
specific Person is being referenced instead of updating just the Person
record (as a separated entity in an 0:1 relationship).
This feature is not uncommon in another frameworks like Hibernate, Entity
Framework, etc. And I see it may be very useful for a lot of scenarios.
Thanks for the response on this!
Em 30 de mai de 2018 7:40 PM, <buganizer-system@google.com> escreveu:
Replying to this email means your email address will be shared with the
team that works on this product.
https://issuetracker.google.com/issues/79307675
*Changed*
component: Android Public Tracker > App Development > Architecture
Components → Android Public Tracker > App Development > Architecture
Components > Room Persistence Library
*yb...@google.com <yb...@google.com> added comment #2
<https://issuetracker.google.com/issues/79307675#comment2 >:*
We do want people to use Embedded as it is usually faster.
Can you add more details on why you cannot use Embedded?
FYI we are not against support 1-1 in @Relation, it is just trickier to
implement and not necessarily preferred over @Embedded so we would like to
better understand the issue
_______________________________
*Reference Info: 79307675 Room support for directly 0:1 entity relationship
(not just the supported 0:N with @Relation)*
component: Android Public Tracker > App Development > Architecture
Components > Room Persistence Library
status: New
reporter: luanmm@gmail.com
cc: an...@google.com, luanmm@gmail.com
type: Bug P3 S3
Generated by Google IssueTracker notification system
You're receiving this email because you are subscribed to updates on Google
IssueTracker issue 79307675
<https://issuetracker.google.com/issues/79307675 > where you have the roles:
reporter, cc.
entity management is done separately.
When we have just a Person attached to an Invoice, to represent the
consumer, for instance, we can't just embed it when the management of the
Person entity is done in another context. Using @Embedded in this scenario
implies that we would need to update all Invoice records where some
specific Person is being referenced instead of updating just the Person
record (as a separated entity in an 0:1 relationship).
This feature is not uncommon in another frameworks like Hibernate, Entity
Framework, etc. And I see it may be very useful for a lot of scenarios.
Thanks for the response on this!
Em 30 de mai de 2018 7:40 PM, <buganizer-system@google.com> escreveu:
Replying to this email means your email address will be shared with the
team that works on this product.
*Changed*
component: Android Public Tracker > App Development > Architecture
Components → Android Public Tracker > App Development > Architecture
Components > Room Persistence Library
*yb...@google.com <yb...@google.com> added
<
We do want people to use Embedded as it is usually faster.
Can you add more details on why you cannot use Embedded?
FYI we are not against support 1-1 in @Relation, it is just trickier to
implement and not necessarily preferred over @Embedded so we would like to
better understand the issue
_______________________________
*Reference Info: 79307675 Room support for directly 0:1 entity relationship
(not just the supported 0:N with @Relation)*
component: Android Public Tracker > App Development > Architecture
Components > Room Persistence Library
status: New
reporter: luanmm@gmail.com
cc: an...@google.com, luanmm@gmail.com
type: Bug P3 S3
Generated by Google IssueTracker notification system
You're receiving this email because you are subscribed to updates on Google
IssueTracker
<
reporter, cc.
yb...@google.com <yb...@google.com>
[Deleted User] <[Deleted User]> #5
delete
Description
Version used: 1.1.0-rc1
Devices/Android versions reproduced on: anyone
The @Relation annotation allows POJOs to have a 0:N relationship out-of-the-box, but why not to allow the same feature for simple 0:1 relationships? It is planned to be supported in the near future?
Nowadays, if I insist using Room in my project, I need to map all the fields through an specific query with JOINs that will populate POJO by named fields (annotated with @ColumnInfo).
In my scenario the @Embedded utility can't be used for all referenced sub-fields, because some content must be managed independently.
Use case: any 0:1 relationships that must be controlled by distinct entities. This is a very common scenario and, to be honest, I'm very suprised that it isn't working out-of-the-box already, at least using @Relation as we do for Lists and Sets (but referencing another @Entity directly, in this case).