Skip to content

Commit b52c6df

Browse files
committed
use static variable for dao
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 64307c8 commit b52c6df

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • app/src/main/java/com/nextcloud/client/database/dao

app/src/main/java/com/nextcloud/client/database/dao/ShareDao.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import androidx.room.OnConflictStrategy
1313
import androidx.room.Query
1414
import com.nextcloud.client.database.entity.ShareEntity
1515
import com.nextcloud.client.database.entity.model.ShareeKey
16+
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta
1617

1718
@Dao
1819
interface ShareDao {
@@ -24,8 +25,8 @@ interface ShareDao {
2425
suspend fun clearSharesForAccount(accountName: String)
2526

2627
@Query(
27-
"SELECT path, shate_with, share_type FROM ocshares " +
28-
"WHERE path IN (:paths) AND owner_share = :accountName AND share_type IN (:shareTypes)"
28+
"SELECT path, ${ProviderTableMeta.OCSHARES_SHARE_WITH}, ${ProviderTableMeta.OCSHARES_SHARE_TYPE} FROM ${ProviderTableMeta.OCSHARES_TABLE_NAME} " +
29+
"WHERE path IN (:paths) AND owner_share = :accountName AND ${ProviderTableMeta.OCSHARES_SHARE_TYPE} IN (:shareTypes)"
2930
)
3031
fun getShareeKeys(paths: List<String>, accountName: String, shareTypes: List<Int>): List<ShareeKey>
3132
}

0 commit comments

Comments
 (0)