Fix folder and feed check queries returning bad results

This commit is contained in:
Shinokuni 2019-05-24 22:35:52 +02:00
parent c4d00fe2e1
commit a12dfa6f13
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ public interface FeedDao {
@Query("Select case When :feedUrl In (Select url from Feed) Then 'true' else 'false' end")
String feedExists(String feedUrl);
@Query("Select case When remoteId = :remoteId And account_id = :accountId Then 1 else 0 end From Feed")
@Query("Select case When :remoteId In (Select remoteId from Feed) And :accountId In (Select account_id From Feed) Then 1 else 0 end")
boolean remoteFeedExists(int remoteId, int accountId);
@Query("Select count(*) from Feed")

View File

@ -31,6 +31,6 @@ public interface FolderDao {
@Query("Select id From Folder Where remoteId = :remoteId And account_id = :accountId")
int getRemoteFolderLocalId(int remoteId, int accountId);
@Query("Select case When remoteId = :remoteId And account_id = :accountId Then 1 else 0 end From Folder")
@Query("Select case When :remoteId In (Select remoteId From Folder) And :accountId In (Select account_id From Folder)Then 1 else 0 end")
boolean remoteFolderExists(int remoteId, int accountId);
}