Proyectos de Subversion Android Microlearning - Inconcert

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 gabriel 1
package com.cesams.twogetskills.inconcert.dao;
2
 
3
import androidx.room.Dao;
4
import androidx.room.Insert;
5
import androidx.room.Query;
6
import androidx.room.Update;
7
 
8
import com.cesams.twogetskills.inconcert.entity.NotificationCenter;
9
import com.cesams.twogetskills.inconcert.room.ResultCount;
10
 
11
import java.util.List;
12
 
13
@Dao
14
public interface NotificationCenterDao {
15
 
16
    @Query("SELECT COUNT(*) AS count FROM tb_notification")
17
    ResultCount getCountNotification();
18
 
19
    @Query("SELECT * FROM tb_notification")
20
    List<NotificationCenter> selectAllNotification();
21
 
7 gabriel 22
    @Query("SELECT * FROM tb_notification group by date order by date DESC")
23
    List<NotificationCenter> selectAllNotificationOrderDay();
24
 
25
    @Query("SELECT * FROM tb_notification where date = :date")
26
    List<NotificationCenter> selectAllNotificationInDay(String date);
27
 
1 gabriel 28
    @Query("SELECT * FROM tb_notification WHERE id = :id LIMIT 1")
29
    NotificationCenter selectNotificationByUuid(String id);
30
 
31
    @Insert
32
    void insert(NotificationCenter notificationCenter);
33
 
34
    @Update
35
    void update(NotificationCenter notificationCenter);
36
 
37
    @Query("DELETE FROM tb_notification WHERE id = :id")
38
    void removeNotificationByUuid(String id);
39
 
40
    @Query("DELETE FROM tb_notification")
41
    void removeAllnotifications();
42
 
43
}