SHARE
TWEET

Untitled

a guest Oct 12th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Dao
  2. public interface FifaDao {
  3.  
  4.     @Insert
  5.     void insertProfile(ProfileEntity profileEntity);
  6.  
  7.     @Insert
  8.     void insertAward(AwardEntity awardEntity);
  9.  
  10.     @Query("SELECT * FROM profile")
  11.     List<ProfileEntity> loadAllProfile();
  12.  
  13.     @Query("SELECT player_id FROM profile WHERE player_name LIKE :playerName ")
  14.     int findPlayerIdWithPlayerName(String playerName);
  15.  
  16.     @Query("SELECT profile.player_name AS playerName" +
  17.             ", profile.player_position AS playerPosition" +
  18.             ", profile.player_club AS playerClub" +
  19.             ", award.fifa_award AS fifaAward" +
  20.             ", award.fifa_award_season AS fifaAwardSeason" +
  21.             " FROM profile, award" +
  22.             " WHERE profile.player_id = award.player_id")
  23.     List<PlayerWithAward> loadPlayerWithAward();
  24.  
  25.     @Query("SELECT player_id AS playerId" +
  26.             ", player_name AS playerName" +
  27.             ", player_club AS playerClub" +
  28.             ", player_contract_commence AS playerContractCommence" +
  29.             ", player_contract_exp AS playerContractExp" +
  30.             ", player_contract_exp-player_contract_commence AS ContractExp" +
  31.             " FROM profile")
  32.     List<PlayerContract> loadAllContract();
  33.  
  34.     @Query("UPDATE profile " +
  35.             " SET player_contract_commence = :playerContractCommence" +
  36.             ", player_contract_exp = :playerContractExp" +
  37.             " WHERE player_id = :playerId")
  38.     void updatePlayerContract(int playerId, int playerContractCommence, int playerContractExp);
  39.  
  40.     @Query("DELETE FROM profile WHERE player_id = :playerId")
  41.     void deletePlayerByPlayerId(int playerId);
  42.  
  43.     @Query("DELETE FROM profile")
  44.     void deleteAllPlayer();
  45.  
  46.     @Query("DELETE FROM award")
  47.     void deleteAllAward();
  48.  
  49. }
RAW Paste Data
Top