Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SingleCardWidgetModelDao.java « widgets « dao « db « adapters « sync « persistence « deck « nextcloud « niedermann « it « java « main « src « app - github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a26269c30a258e0203266fba2ebfc5fa2eebb3e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets;

import androidx.room.Dao;
import androidx.room.Query;
import androidx.room.Transaction;

import it.niedermann.nextcloud.deck.model.full.FullSingleCardWidgetModel;
import it.niedermann.nextcloud.deck.model.widget.singlecard.SingleCardWidgetModel;
import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao;

@Dao
public interface SingleCardWidgetModelDao extends GenericDao<SingleCardWidgetModel> {

    @Transaction
    @Query("SELECT * FROM singlecardwidgetmodel WHERE widgetId = :widgetId")
    FullSingleCardWidgetModel getFullCardByRemoteIdDirectly(final int widgetId);

    @Transaction
    @Query("SELECT EXISTS (SELECT 1 FROM singlecardwidgetmodel WHERE cardId = :cardLocalId)")
    boolean containsCardLocalId(final Long cardLocalId);
}