You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have a message entity, I want to create a message table whose name is "messagefromAToB" when a userA chat to a userB, and create a message table whose name is "messagefromAToC" when a userA chat to a userC; How can I achieve this by greenDao?
greenDAO works based on the notion that there is one table per entity. If you want different tables you have to create different entities.
In your case I suggest you use one table/entity and add some identifiers, like the sender and receiver, to the entity to allow querying for the messages between certain users.
-ut
For some reason I want to use a different name's table to distinguish between different objects, such as chat records synchronization;Do greenDao have plans to implement one entity corresponding to multiple tables?
Activity
greenrobot-team commentedon Sep 27, 2016
greenDAO works based on the notion that there is one table per entity. If you want different tables you have to create different entities.
In your case I suggest you use one table/entity and add some identifiers, like the sender and receiver, to the entity to allow querying for the messages between certain users.
-ut
jaydenyuhy commentedon Sep 28, 2016
For some reason I want to use a different name's table to distinguish between different objects, such as chat records synchronization;Do greenDao have plans to implement one entity corresponding to multiple tables?