Modify alarms schema

pull/618/head
Alex Baker 8 years ago
parent 87c477ac3c
commit ddf6b75f7d

@ -2,7 +2,7 @@
"formatVersion": 1,
"database": {
"version": 47,
"identityHash": "d34ba028da3599fe5ea241c5c619aa6c",
"identityHash": "37451381475d08b0ea64f44ee82fd9ae",
"entities": [
{
"tableName": "notification",
@ -590,25 +590,25 @@
},
{
"tableName": "alarms",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `task` INTEGER, `time` INTEGER)",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task` INTEGER NOT NULL, `time` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "_id",
"affinity": "INTEGER",
"notNull": false
"notNull": true
},
{
"fieldPath": "task",
"columnName": "task",
"affinity": "INTEGER",
"notNull": false
"notNull": true
},
{
"fieldPath": "time",
"columnName": "time",
"affinity": "INTEGER",
"notNull": false
"notNull": true
}
],
"primaryKey": {
@ -623,7 +623,7 @@
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"d34ba028da3599fe5ea241c5c619aa6c\")"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"37451381475d08b0ea64f44ee82fd9ae\")"
]
}
}

@ -13,13 +13,13 @@ public class Alarm {
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "_id")
private Long id;
private long id;
@ColumnInfo(name = "task")
private Long task;
private long task;
@ColumnInfo(name = "time")
private Long time;
private long time;
public Alarm() {
@ -36,27 +36,27 @@ public class Alarm {
writer.writeLong("time", time);
}
public Long getId() {
public long getId() {
return id;
}
public void setId(Long id) {
public void setId(long id) {
this.id = id;
}
public Long getTask() {
public long getTask() {
return task;
}
public void setTask(Long task) {
public void setTask(long task) {
this.task = task;
}
public Long getTime() {
public long getTime() {
return time;
}
public void setTime(Long time) {
public void setTime(long time) {
this.time = time;
}
@ -67,16 +67,16 @@ public class Alarm {
Alarm alarm = (Alarm) o;
if (id != null ? !id.equals(alarm.id) : alarm.id != null) return false;
if (task != null ? !task.equals(alarm.task) : alarm.task != null) return false;
return time != null ? time.equals(alarm.time) : alarm.time == null;
if (id != alarm.id) return false;
if (task != alarm.task) return false;
return time == alarm.time;
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (task != null ? task.hashCode() : 0);
result = 31 * result + (time != null ? time.hashCode() : 0);
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (task ^ (task >>> 32));
result = 31 * result + (int) (time ^ (time >>> 32));
return result;
}

Loading…
Cancel
Save