Commit d9cdc68a by Tuukka Kivilahti

Merge branch 'devel' of codecrew.fi:bortal into devel

2 parents 4d00867f 6dedebc5
package fi.codecrew.moya.facade;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import fi.codecrew.moya.model.Tournament;
@Stateless
@LocalBean
public class TournamentFacade extends IntegerPkGenericFacade<Tournament> {
public TournamentFacade() {
super(Tournament.class);
}
}
package fi.codecrew.moya.facade;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import fi.codecrew.moya.model.TournamentGame;
@Stateless
@LocalBean
public class TournamentGameFacade extends IntegerPkGenericFacade<TournamentGame> {
public TournamentGameFacade() {
super(TournamentGame.class);
}
}
package fi.codecrew.moya.facade;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import fi.codecrew.moya.model.TournamentMatch;
@Stateless
@LocalBean
public class TournamentMatchFacade extends IntegerPkGenericFacade<TournamentMatch> {
public TournamentMatchFacade() {
super(TournamentMatch.class);
}
}
\ No newline at end of file
package fi.codecrew.moya.facade;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import fi.codecrew.moya.model.TournamentMatchResult;
@Stateless
@LocalBean
public class TournamentMatchResultFacade extends IntegerPkGenericFacade<TournamentMatchResult> {
public TournamentMatchResultFacade() {
super(TournamentMatchResult.class);
}
}
\ No newline at end of file
package fi.codecrew.moya.facade;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import fi.codecrew.moya.model.TournamentParticipant;
@Stateless
@LocalBean
public class TournamentParticipantFacade extends IntegerPkGenericFacade<TournamentParticipant> {
public TournamentParticipantFacade() {
super(TournamentParticipant.class);
}
}
package fi.codecrew.moya.facade;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import fi.codecrew.moya.model.TournamentRule;
@Stateless
@LocalBean
public class TournamentRuleFacade extends IntegerPkGenericFacade<TournamentRule> {
public TournamentRuleFacade() {
super(TournamentRule.class);
}
}
package fi.codecrew.moya.model;
import fi.codecrew.moya.enums.TournamentStatus;
import fi.codecrew.moya.enums.TournamentType;
import fi.codecrew.moya.model.GenericEntity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* Entity implementation class for Entity: Tournament
*
*/
@Entity
@Table(name="tournaments")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Tournament extends GenericEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Column(name="talyn_tournament_id", nullable=true)
private Integer talynTournamentId;
@JoinColumn(name = "event_id", nullable = false)
private LanEvent lanEvent;
@Column(name="tournament_name")
private String tournamentName;
@Column(name="registration_opens_at")
@Temporal(TemporalType.TIMESTAMP)
private Date registrationOpensAt;
@Column(name="registration_closes_at")
@Temporal(TemporalType.TIMESTAMP)
private Date registrationClosesAt;
@Column(name="begins_at")
@Temporal(TemporalType.TIMESTAMP)
private Date beginsAt;
@Column(name="tournament_type")
@Enumerated(EnumType.STRING)
private TournamentType tournamentType;
@Column(name="tournament_status")
@Enumerated(EnumType.STRING)
private TournamentStatus tournamentStatus;
@JoinColumn(name="tournament_root")
private TournamentMatch tournamentRoot;
@Column(name="players_per_match")
private Integer playersPerMatch;
@Column(name="players_per_team")
private Integer playersPerTeam;
@OneToMany
@OrderBy("id ASC")
private List<Tournament> subTournaments;
public Tournament() { super(); }
public Integer getTalynTournamentId() {
return talynTournamentId;
}
public void setTalynTournamentId(Integer talynTournamendId) {
this.talynTournamentId = talynTournamendId;
}
public String getTournamentName() {
return tournamentName;
}
public void setTournamentName(String tournamentName) {
this.tournamentName = tournamentName;
}
public Date getRegistrationOpensAt() {
return registrationOpensAt;
}
public void setRegistrationOpensAt(Date registrationOpensAt) {
this.registrationOpensAt = registrationOpensAt;
}
public Date getRegistrationClosesAt() {
return registrationClosesAt;
}
public void setRegistrationClosesAt(Date registrationClosesAt) {
this.registrationClosesAt = registrationClosesAt;
}
public TournamentType getTournamentType() {
return tournamentType;
}
public void setTournamentType(TournamentType tournamentType) {
this.tournamentType = tournamentType;
}
}
package fi.codecrew.moya.model;
import static javax.persistence.FetchType.LAZY;
import fi.codecrew.moya.enums.TournamentType;
import fi.codecrew.moya.model.GenericEntity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* Entity implementation class for Entity: Tournament
*
*/
@Entity
@Table(name="tournament_games")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class TournamentGame extends GenericEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Column(name="name")
private String name;
@Column(name="description")
private String description;
@Lob
@Column(name = "game_image")
@Basic(fetch = LAZY)
private byte[] gameImage;
@Column(name = "expected_single_game_duration")
private Integer expectedSingleGameDuration;
@JoinColumn(name = "event_id", nullable = false)
private LanEvent lanEvent;
@OneToMany
private List<TournamentRule> availableRules;
public TournamentGame() { super(); }
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<TournamentRule> getAvailableRules() {
return availableRules;
}
public void setAvailableRules(List<TournamentRule> availableRules) {
this.availableRules = availableRules;
}
}
package fi.codecrew.moya.model;
import fi.codecrew.moya.enums.MatchStatus;
import fi.codecrew.moya.model.GenericEntity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* Entity implementation class for Entity: Match
*
*/
@Entity
@Table(name="matches")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class TournamentMatch extends GenericEntity implements Serializable {
private static final long serialVersionUID = 1L;
@OneToMany
private List<TournamentMatch> sourceMatches;
@ManyToMany
private List<TournamentParticipant> matchParticipants;
@Column(name="play_count_max")
private Integer playCountMax = 1;
@Column(name="play_count")
private Integer playCount;
@Column(name="match_status")
@Enumerated(EnumType.STRING)
private MatchStatus matchStatus;
@Temporal(TemporalType.TIMESTAMP)
private Date startTime;
@Temporal(TemporalType.TIMESTAMP)
private Date endTime;
@OneToMany
@OrderBy("rank")
private List<TournamentMatchResult> matchResults;
public TournamentMatch() {
super();
}
public List<TournamentMatch> getSourceMatches() {
return sourceMatches;
}
public void setSourceMatches(List<TournamentMatch> sourceMatches) {
this.sourceMatches = sourceMatches;
}
public List<TournamentParticipant> getMatchParticipants() {
return matchParticipants;
}
public void setMatchParticipants(List<TournamentParticipant> matchParticipants) {
this.matchParticipants = matchParticipants;
}
public List<TournamentMatchResult> getMatchResults() {
return matchResults;
}
public void setMatchResults(List<TournamentMatchResult> matchResults) {
this.matchResults = matchResults;
}
}
package fi.codecrew.moya.model;
import java.io.Serializable;
import javax.persistence.*;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* Entity implementation class for Entity: MatchResult
*
*/
@Entity
@Table(name="match_results")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class TournamentMatchResult extends GenericEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Column(name="score")
private Integer score;
@Column(name="rank")
private Integer rank;
@JoinColumn(name="tournament_participant")
private TournamentParticipant tournamentParticipant;
public TournamentMatchResult() {
super();
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
public Integer getRank() {
return rank;
}
public void setRank(Integer rank) {
this.rank = rank;
}
public TournamentParticipant getTournamentParticipant() {
return tournamentParticipant;
}
public void setTournamentParticipant(TournamentParticipant tournamentParticipant) {
this.tournamentParticipant = tournamentParticipant;
}
}
package fi.codecrew.moya.model;
import fi.codecrew.moya.model.GenericEntity;
import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* Entity implementation class for Entity: TournamentParticipant
*
*/
@Entity
@Table(name="tournament_participants")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class TournamentParticipant extends GenericEntity implements Serializable {
private static final long serialVersionUID = 1L;
@JoinColumn(name="participator")
private EventUser participator;
@OneToMany
private List<EventUser> teamMembers;
public TournamentParticipant() {
super();
}
}
package fi.codecrew.moya.model;
import static javax.persistence.FetchType.LAZY;
import fi.codecrew.moya.enums.TournamentType;
import fi.codecrew.moya.model.GenericEntity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* Entity implementation class for Entity: Tournament
*
*/
@Entity
@Table(name="tournament_rules")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class TournamentRule extends GenericEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Column(name="name")
private String name;
@Lob
@Column(name="description")
private String description;
@Lob
@Column(name="rules")
private String rules;
@ManyToOne
@JoinColumn(name = "tournament_game_id")
private TournamentGame tournamentGame;
public TournamentRule() { super(); }
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getRules() {
return rules;
}
public void setRules(String rules) {
this.rules = rules;
}
}
package fi.codecrew.moya.enums;
public enum MatchStatus {
UNFINISHED,
FINISHED
}
package fi.codecrew.moya.enums;
public enum TournamentStatus {
SETUP,
IN_PROGRESS,
COMPLETED
}
package fi.codecrew.moya.enums;
public enum TournamentType {
SINGLE_ELIMINATION,
DOUBLE_ELIMINATION
}
......@@ -10,7 +10,7 @@
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<!-- Production | Development -->
<param-value>Development</param-value>
<param-value>Production</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!