| 1 |
gabriel |
1 |
package com.cesams.twogetskills.inconcert.dao;
|
|
|
2 |
|
|
|
3 |
|
|
|
4 |
import androidx.room.Dao;
|
|
|
5 |
import androidx.room.Insert;
|
|
|
6 |
import androidx.room.Query;
|
|
|
7 |
import androidx.room.Update;
|
|
|
8 |
|
|
|
9 |
import com.cesams.twogetskills.inconcert.entity.Company;
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
import java.util.List;
|
|
|
13 |
|
|
|
14 |
@Dao
|
|
|
15 |
public interface CompanyDao {
|
|
|
16 |
|
|
|
17 |
@Query( "SELECT * FROM tb_companies ORDER BY name ")
|
|
|
18 |
List<Company> selectAll();
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
@Query("select * from tb_companies WHERE uuid = :uuid")
|
|
|
22 |
Company selectByUuid(String uuid);
|
|
|
23 |
|
|
|
24 |
@Insert
|
|
|
25 |
void insert(Company company);
|
|
|
26 |
|
|
|
27 |
@Update
|
|
|
28 |
void update(Company company);
|
|
|
29 |
|
|
|
30 |
@Query("DELETE FROM tb_companies WHERE uuid = :uuid")
|
|
|
31 |
void removeByUuid(String uuid);
|
|
|
32 |
|
|
|
33 |
@Query("DELETE FROM tb_companies")
|
|
|
34 |
void removeAll();
|
|
|
35 |
|
|
|
36 |
}
|