From 9bef41a13b523b5153d0ee612fd66d53f8720d69 Mon Sep 17 00:00:00 2001 From: ganfra Date: Fri, 12 Oct 2018 16:50:54 +0200 Subject: [PATCH] Start creating database model --- .../android/internal/database/model/ChunkEntity.kt | 13 +++++++++++++ .../android/internal/database/model/EventEntity.kt | 14 ++++++++++++++ .../android/internal/database/model/RoomEntity.kt | 12 ++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/ChunkEntity.kt create mode 100644 matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/EventEntity.kt create mode 100644 matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/RoomEntity.kt diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/ChunkEntity.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/ChunkEntity.kt new file mode 100644 index 0000000000..345de4dc2a --- /dev/null +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/ChunkEntity.kt @@ -0,0 +1,13 @@ +package im.vector.matrix.android.internal.database.model + +import io.objectbox.annotation.Entity +import io.objectbox.annotation.Id +import io.objectbox.relation.ToMany + +@Entity +class ChunkEntity { + @Id var id: Long = 0 + var prevToken: String? = null + var nextToken: String? = null + lateinit var events: ToMany +} \ No newline at end of file diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/EventEntity.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/EventEntity.kt new file mode 100644 index 0000000000..9c8c2e27f3 --- /dev/null +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/EventEntity.kt @@ -0,0 +1,14 @@ +package im.vector.matrix.android.internal.database.model + +import io.objectbox.annotation.Entity +import io.objectbox.annotation.Id + +@Entity +class EventEntity { + @Id var id: Long = 0 + lateinit var eventId: String + lateinit var type: String + lateinit var content: String + var prevContent: String? = null + var stateKey: String? = null +} \ No newline at end of file diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/RoomEntity.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/RoomEntity.kt new file mode 100644 index 0000000000..cf017cbec1 --- /dev/null +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/database/model/RoomEntity.kt @@ -0,0 +1,12 @@ +package im.vector.matrix.android.internal.database.model + +import io.objectbox.annotation.Entity +import io.objectbox.annotation.Id +import io.objectbox.relation.ToMany + +@Entity +class RoomEntity { + @Id var id: Long = 0 + lateinit var roomId: String + lateinit var chunks: ToMany +} \ No newline at end of file