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

Added Custom ID annotation, option to define one of your model's columns as secondary id #400

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yoavi2
Copy link

@yoavi2 yoavi2 commented Jul 30, 2015

Added Custom ID annotation, option to define one of your model's columns as secondary id (Thus adding the option to use the server's id type such as String) for updating existing objects, with the same server id, that were retrieved from the server (objects with a different server id will be inserted normally)

Usage example:

@Table(name = LocationEntity.TABLE_NAME, id = BaseColumns._ID, customIdName = LocationEntity.OBJECT_ID)

the Column is defined the same (we use String in the example):

    @Column(name = OBJECT_ID,
            notNull = true,
            unique = true,
            onNullConflict = Column.ConflictAction.FAIL)
    public String objectId;

…mns as secondary id (Thus adding the option to use the server's id type such as String) for updating existing objects, with the same server id, that were retrieved from the server (objects with a different server id will be inserted normally)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant