I have a table with the following schema :
public static final String PRIMARY_KEY = "_id";
public static final String TASK_NAME = "name";
public static final String TASK_DESCRIPTION = "description";
public static final String IS_TASK_COMPLETED = "is_completed";
public static final String IS_TASK_DELETED = "is_deleted";
public static final String TASK_START_DATE = "start_date";
public static final String TASK_START_TIME = "start_time";
public static final String ESTIMATED_TASK_END_DATE = "end_date";
public static final String TIMESTAMP = "timestamp";
In one fragment I'm inserting a row in the table using the insert()
method. I know that this returns the rowId
of the inserted row but in this thread I read that
If a table contains a column of type INTEGER PRIMARY KEY, then that column becomes an alias for the ROWID. You can then access the ROWID using any of four different names, the original three names described above or the name given to the INTEGER PRIMARY KEY column. All these names are aliases for one another and work equally well in any context.
So will the returning rowId be same as the primary key. But what if a row is deleted and another row is inserted in that case will the rowId
be as same as the primary key value "id"
?