Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4218fe4c
authored
Mar 31, 2013
by
Antti Tönkyrä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
II-Match
1 parent
f818b38f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
192 additions
and
0 deletions
code/MoyaDatabase/src/fi/codecrew/moya/model/Match.java
code/MoyaDatabase/src/fi/codecrew/moya/model/MatchResult.java
code/MoyaDatabase/src/fi/codecrew/moya/model/Tournament.java
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentParticipant.java
code/MoyaUtilities/src/fi/codecrew/moya/enums/TournamentType.java
code/MoyaDatabase/src/fi/codecrew/moya/model/Match.java
0 → 100644
View file @
4218fe4
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: Match
*
*/
@Entity
@Table
(
name
=
"matches"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
Match
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@OneToMany
private
List
<
Match
>
sourceMatches
;
@ManyToMany
private
List
<
TournamentParticipant
>
matchParticipants
;
@OneToMany
@OrderBy
(
"ranking"
)
private
List
<
MatchResult
>
matchResults
;
public
Match
()
{
super
();
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/MatchResult.java
0 → 100644
View file @
4218fe4
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
MatchResult
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
MatchResult
()
{
super
();
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/Tournament.java
0 → 100644
View file @
4218fe4
package
fi
.
codecrew
.
moya
.
model
;
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
;
@Column
(
name
=
"tournament_name"
)
private
String
tournamentName
;
@Column
(
name
=
"registration_opens_at"
)
private
Date
registrationOpensAt
;
@Column
(
name
=
"registration_closes_at"
)
private
Date
registrationClosesAt
;
@Column
(
name
=
"tournament_type"
)
@Enumerated
(
EnumType
.
STRING
)
private
TournamentType
tournamentType
;
@JoinColumn
(
name
=
"tournament_root"
)
private
Match
tournamentRoot
;
@OneToMany
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
;
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentParticipant.java
0 → 100644
View file @
4218fe4
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
();
}
}
code/MoyaUtilities/src/fi/codecrew/moya/enums/TournamentType.java
0 → 100644
View file @
4218fe4
package
fi
.
codecrew
.
moya
.
enums
;
public
enum
TournamentType
{
SINGLE_ELIMINATION
,
DOUBLE_ELIMINATION
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment