Skip to content

How can an entity created a list of different name's tables ? #455

Closed
@jaydenyuhy

Description

@jaydenyuhy

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?

Activity

greenrobot-team

greenrobot-team commented on Sep 27, 2016

@greenrobot-team
Collaborator

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

jaydenyuhy commented on Sep 28, 2016

@jaydenyuhy
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jaydenyuhy@greenrobot-team

        Issue actions

          How can an entity created a list of different name's tables ? · Issue #455 · greenrobot/greenDAO