// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/domain/Player.java
// @Table(name = "Player") public class Player extends Model {
// 
//   @SerializedName(value = "atleta_id") @Column(name = "PlayerId") String playerId;
//   @SerializedName(value = "nome") @Column(name = "Name") String name;
//   @SerializedName(value = "foto") @Column(name = "Photo") String photo;
//   @SerializedName(value = "preco_num") @Column(name = "Price") double price;
//   @SerializedName(value = "time_id") @Column(name = "Var") double var;
//   @SerializedName(value = "time_id") @Column(name = "Average") double average;
//   @SerializedName(value = "time_id") @Column(name = "Points") double points;
//   @SerializedName(value = "time_id") @Column(name = "Matches") double matches;
//   @SerializedName(value = "time_id") @Column(name = "ClubId") long clubId;
// 
//   public Player() {
//     super();
//   }
// 
//   public String getPlayerId() {
//     return playerId;
//   }
// 
//   public void setPlayerId(String playerId) {
//     this.playerId = playerId;
//   }
// 
//   public String getName() {
//     return name;
//   }
// 
//   public void setName(String name) {
//     this.name = name;
//   }
// 
//   public String getPhoto() {
//     return photo;
//   }
// 
//   public void setPhoto(String photo) {
//     this.photo = photo;
//   }
// 
//   public double getPrice() {
//     return price;
//   }
// 
//   public void setPrice(double price) {
//     this.price = price;
//   }
// 
//   public double getVar() {
//     return var;
//   }
// 
//   public void setVar(double var) {
//     this.var = var;
//   }
// 
//   public double getAverage() {
//     return average;
//   }
// 
//   public void setAverage(double average) {
//     this.average = average;
//   }
// 
//   public double getMatches() {
//     return matches;
//   }
// 
//   public void setMatches(double matches) {
//     this.matches = matches;
//   }
// 
//   public long getClubId() {
//     return clubId;
//   }
// 
//   public void setClubId(long clubId) {
//     this.clubId = clubId;
//   }
// 
//   public double getPoints() {
//     return points;
//   }
// 
//   public void setPoints(double points) {
//     this.points = points;
//   }
// }
// 
// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/domain/contracts/IPlayerRepository.java
// public interface IPlayerRepository extends ICrud<Player> {
// }


import com.activeandroid.query.Delete;
import com.activeandroid.query.Select;
import com.github.pierry.cartolapp.domain.Player;
import com.github.pierry.cartolapp.domain.contracts.IPlayerRepository;
import java.util.Collections;
import java.util.List;
import org.androidannotations.annotations.EBean;
package com.github.pierry.cartolapp.repositories;


@EBean public class PlayerRepository implements IPlayerRepository {

  @Override public List<Player> get() {
    try {
      return new Select().from(Player.class).execute();
    } catch (Exception e) {
      return Collections.emptyList();
    }
  }

  @Override public Player getById(long id) {
    try {
      return new Select().from(Player.class).where("PlayerId = ?", id).executeSingle();
    } catch (Exception e) {
      return null;
    }
  }

  @Override public long create(Player item) {
    try {
      return item.save();
    } catch (Exception e) {
      e.printStackTrace();
      return 0;
    }
  }

// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/domain/Player.java
// @Table(name = "Player") public class Player extends Model {
// 
//   @SerializedName(value = "atleta_id") @Column(name = "PlayerId") String playerId;
//   @SerializedName(value = "nome") @Column(name = "Name") String name;
//   @SerializedName(value = "foto") @Column(name = "Photo") String photo;
//   @SerializedName(value = "preco_num") @Column(name = "Price") double price;
//   @SerializedName(value = "time_id") @Column(name = "Var") double var;
//   @SerializedName(value = "time_id") @Column(name = "Average") double average;
//   @SerializedName(value = "time_id") @Column(name = "Points") double points;
//   @SerializedName(value = "time_id") @Column(name = "Matches") double matches;
//   @SerializedName(value = "time_id") @Column(name = "ClubId") long clubId;
// 
//   public Player() {
//     super();
//   }
// 
//   public String getPlayerId() {
//     return playerId;
//   }
// 
//   public void setPlayerId(String playerId) {
//     this.playerId = playerId;
//   }
// 
//   public String getName() {
//     return name;
//   }
// 
//   public void setName(String name) {
//     this.name = name;
//   }
// 
//   public String getPhoto() {
//     return photo;
//   }
// 
//   public void setPhoto(String photo) {
//     this.photo = photo;
//   }
// 
//   public double getPrice() {
//     return price;
//   }
// 
//   public void setPrice(double price) {
//     this.price = price;
//   }
// 
//   public double getVar() {
//     return var;
//   }
// 
//   public void setVar(double var) {
//     this.var = var;
//   }
// 
//   public double getAverage() {
//     return average;
//   }
// 
//   public void setAverage(double average) {
//     this.average = average;
//   }
// 
//   public double getMatches() {
//     return matches;
//   }
// 
//   public void setMatches(double matches) {
//     this.matches = matches;
//   }
// 
//   public long getClubId() {
//     return clubId;
//   }
// 
//   public void setClubId(long clubId) {
//     this.clubId = clubId;
//   }
// 
//   public double getPoints() {
//     return points;
//   }
// 
//   public void setPoints(double points) {
//     this.points = points;
//   }
// }
// 
// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/domain/contracts/IPlayerRepository.java
// public interface IPlayerRepository extends ICrud<Player> {
// }


// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/repositories/PlayerRepository.java
import com.activeandroid.query.Delete;
import com.activeandroid.query.Select;
import com.github.pierry.cartolapp.domain.Player;
import com.github.pierry.cartolapp.domain.contracts.IPlayerRepository;
import java.util.Collections;
import java.util.List;
import org.androidannotations.annotations.EBean;

package com.github.pierry.cartolapp.repositories;


@EBean public class PlayerRepository implements IPlayerRepository {

  @Override public List<Player> get() {
    try {
      return new Select().from(Player.class).execute();
    } catch (Exception e) {
      return Collections.emptyList();
    }
  }

  @Override public Player getById(long id) {
    try {
      return new Select().from(Player.class).where("PlayerId = ?", id).executeSingle();
    } catch (Exception e) {
      return null;
    }
  }

  @Override public long create(Player item) {
    try {
      return item.save();
    } catch (Exception e) {
      e.printStackTrace();
      return 0;
    }
  }

  @Override public boolean update(Player item) {