FreeRDP
Loading...
Searching...
No Matches
HistoryDao.java
1/*
2 Connection history data access object
3
4 Copyright 2026 Ibrahim Sevinc <ibrahim.sevinc.mail@gmail.com>
5
6 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 If a copy of the MPL was not distributed with this file, You can obtain one at
8 http://mozilla.org/MPL/2.0/.
9*/
10
11package com.freerdp.freerdpcore.data;
12
13import androidx.room.Dao;
14import androidx.room.Insert;
15import androidx.room.OnConflictStrategy;
16import androidx.room.Query;
17
18import java.util.List;
19
20@Dao
21public interface HistoryDao {
22 @Query("SELECT * FROM quick_connect_history WHERE item LIKE :filter "
23 + "ORDER BY timestamp DESC LIMIT 50")
24 List<HistoryEntity>
25 findHistory(String filter);
26
27 @Query("SELECT COUNT(*) FROM quick_connect_history WHERE item = :item") int exists(String item);
28
29 @Insert(onConflict = OnConflictStrategy.REPLACE) void insertOrReplace(HistoryEntity entity);
30
31 @Query("DELETE FROM quick_connect_history WHERE item = :item") void deleteByItem(String item);
32}