3 import javax.persistence.Entity;
4 import javax.persistence.GeneratedValue;
5 import javax.persistence.Id;
6 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
12 @XmlJavaTypeAdapter(IntegerAdapter.class)
13 private Integer betNumber;
14 private Forecast forecast;
17 private String estadoApuesta; // Pendiente Ganada Perdida Anulada
19 public String getEstadoApuesta() {
23 public void setEstadoApuesta(String estadoApuesta) {
24 this.estadoApuesta = estadoApuesta;
31 public Bet(Integer n, Forecast forecast, User user, float amount) {
34 this.forecast = forecast;
37 this.estadoApuesta = "Pendiente";
40 public Bet(Forecast forecast, User user, float amount) {
42 this.forecast = forecast;
45 this.estadoApuesta = "Pendiente";
49 public Forecast getForecast() {
53 public void setForecast(Forecast forecast) {
54 this.forecast = forecast;
57 public User getUser() {
61 public void setUser(User user) {
65 public float getAmount() {
69 public void setAmount(float amount) {
74 public String toString() {
75 return "Bet [forecast: " + forecast + ", user: " + user + ", amount: " + amount + "forecast: "
76 + forecast.getForecast() + "question: " + forecast.getQuestion().getQuestion() + "event: "
77 + forecast.getQuestion().getEvent().getDescription() + "]";
80 public String toString2() {
86 return forecast.getQuestion().getEvent().getEventDate().toString().substring(0, 11) + " "
87 + forecast.getQuestion().getEvent().getDescription() + " "
88 + forecast.getQuestion().getQuestion() + " "
89 + this.forecast.getForecast() + " "
91 + forecast.getQuestion().getResult() + " " + this.getAmount()
92 + " " + forecast.getFee();
96 // + "forecast: " + forecast + ", amount: " + amount + "forecast: "
97 // + "question: " + forecast.getQuestion().getQuestion() + "event: "
98 // + forecast.getQuestion().getEvent().getDescription() + "]";
103 public String toString3() {
105 return forecast.getQuestion().getEvent().getEventDate().toString().substring(0, 11)
106 + " " + forecast.getQuestion().getEvent().getDescription()
107 + " " + forecast.getQuestion().getQuestion()
108 + " " + this.forecast.getForecast()
109 + " " + this.getAmount()
110 + " " + forecast.getFee();