SetUpTableDaoに既存情報の呼び出しメソッドの追加

This commit is contained in:
nemukemo 2024-07-08 11:41:12 +09:00
parent a17c2c633f
commit c1f561e005

View File

@ -13,20 +13,24 @@ public interface SetUpTableDao {
//更新処理 //更新処理
@Update @Update
void update(SetUpTable setUpTable); void update(SetUpTable setUpTable);
//名前が一致しているかの確認
//削除処理 //削除処理
@Query("DELETE FROM SetUpTable") @Query("DELETE FROM SetUpTable")
void deleteAll(); void deleteAll();
//全件取得 //全件取得
@Query("SELECT * FROM SetUpTable") @Query("SELECT * FROM SetUpTable")
List<SetUpTable> getAll(); List<SetUpTable> getAll();
//教師名で検索
@Query("SELECT * FROM SetUpTable WHERE teacherName = :name LIMIT 1") @Query("SELECT * FROM SetUpTable WHERE teacherName = :name LIMIT 1")
SetUpTable findByName(String name); SetUpTable findByName(String name);
//教師名の取得
@Query("SELECT teacherName FROM SetUpTable")
String getTeacherName();
//生徒数の取得
@Query("SELECT totalStudent FROM SetUpTable") @Query("SELECT totalStudent FROM SetUpTable")
int getTotalStudent(); int getTotalStudent();
//addressの取得
@Query("SELECT startPoint FROM SetUpTable")
String getAddress();
//開始時間と終了時間の取得 //開始時間と終了時間の取得
@Query("SELECT startTime FROM SetUpTable") @Query("SELECT startTime FROM SetUpTable")
String getStartTime(); String getStartTime();