ISBets21MAUBRY
3cf4057e97448d401b49261033b8ab566105944e
ISBets21MAUBRY / eclipse-workspace / ISBets21MAUBRY / src / main / java / domain / Forecast.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
package domain; import java.util.Vector; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.TableGenerator; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @Entity public class Forecast { @GeneratedValue() @Id @XmlJavaTypeAdapter(IntegerAdapter.class) private Integer forecastNumber; private String forecast; private float fee; private Question question; @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.PERSIST) private Vector<Bet> bets = new Vector<Bet>(); private boolean winnerf; public boolean isWinnerf() { return winnerf; } public void setWinnerf(boolean winnerf) { this.winnerf = winnerf; } public Forecast() { super(); } public Forecast(int n, String s, float f, Question q) { //super(); forecast = s; question = q; fee = f; forecastNumber = n; } public Forecast(String s, float f, Question q) { super(); forecast = s; fee = f; question = q; } public String getForecast() { return forecast; } public void setForecast(String s) { forecast = s; } public Question getQuestion() { return question; } public void setQuestion(Question q) { question = q; } public Integer getForecastNumber() { return forecastNumber; } public void setForecastNumber(int n) { forecastNumber = n; } public float getFee() { return fee; } public void setFee(float f) { fee = f; } @Override public String toString() { return "Forecast: " + forecast + "; " + fee + " ➪ " + question.toString(); } public Bet addBet(Forecast forecast, RegularUser u, float amount) { Bet b = new Bet(this, u, amount); bets.add(b); return b; } public Vector<Bet> getBets() { return bets; } public void setForecasts(Vector<Bet> bets) { this.bets = bets; } } |
Commits for ISBets21MAUBRYeclipse-workspace/ISBets21MAUBRY/src/main/java/domain/Forecast.java
Revision | Author | Commited | Message |
---|---|---|---|
3cf405 ... | porkipig | Sun 16 May, 2021 19:27:29 +0000 | Iteración 3(Versión sin idiomas) |