Skip to content

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