return ConferenceGroups ordered by order_index

This commit is contained in:
Felix 2017-11-03 01:28:57 +01:00
parent 44c0564f81
commit 8b5954f156
2 changed files with 3 additions and 1 deletions

View file

@ -1,5 +1,6 @@
package de.nicidienase.chaosflix.common.entities.recording.persistence package de.nicidienase.chaosflix.common.entities.recording.persistence
import android.arch.persistence.room.ColumnInfo
import android.arch.persistence.room.Entity import android.arch.persistence.room.Entity
import android.arch.persistence.room.Index import android.arch.persistence.room.Index
import android.arch.persistence.room.PrimaryKey import android.arch.persistence.room.PrimaryKey
@ -12,6 +13,7 @@ class ConferenceGroup(
): Parcelable { ): Parcelable {
@PrimaryKey(autoGenerate = true) @PrimaryKey(autoGenerate = true)
var conferenceGroupId: Long = 0 var conferenceGroupId: Long = 0
@ColumnInfo(name = "order_index")
var index: Int = 1_000_000 var index: Int = 1_000_000
constructor(parcel: Parcel) : this(parcel.readString()) { constructor(parcel: Parcel) : this(parcel.readString()) {

View file

@ -8,7 +8,7 @@ import io.reactivex.Flowable
@Dao @Dao
interface ConferenceGroupDao{ interface ConferenceGroupDao{
@Query("SELECT * FROM conference_group") @Query("SELECT * FROM conference_group ORDER BY order_index")
fun getAll(): Flowable<List<ConferenceGroup>> fun getAll(): Flowable<List<ConferenceGroup>>
@Insert(onConflict = OnConflictStrategy.IGNORE) @Insert(onConflict = OnConflictStrategy.IGNORE)