Fixing display of league results.
This commit is contained in:
@@ -45,19 +45,20 @@ public class LeagueSerieDAO {
|
|||||||
try {
|
try {
|
||||||
Connection conn = _dbAccess.getDataSource().getConnection();
|
Connection conn = _dbAccess.getDataSource().getConnection();
|
||||||
try {
|
try {
|
||||||
PreparedStatement statement = conn.prepareStatement("select season_type, format, max_matches, start, end from league_season where league_type=? order by start asc");
|
PreparedStatement statement = conn.prepareStatement("select league_type, season_type, format, max_matches, start, end from league_season where league_type=? order by start asc");
|
||||||
try {
|
try {
|
||||||
statement.setString(1, league.getType());
|
statement.setString(1, league.getType());
|
||||||
ResultSet rs = statement.executeQuery();
|
ResultSet rs = statement.executeQuery();
|
||||||
try {
|
try {
|
||||||
List<LeagueSerie> seasons = new LinkedList<LeagueSerie>();
|
List<LeagueSerie> seasons = new LinkedList<LeagueSerie>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
String type = rs.getString(1);
|
String leagueType = rs.getString(1);
|
||||||
String format = rs.getString(2);
|
String type = rs.getString(2);
|
||||||
int maxMatches = rs.getInt(3);
|
String format = rs.getString(3);
|
||||||
int start = rs.getInt(4);
|
int maxMatches = rs.getInt(4);
|
||||||
int end = rs.getInt(5);
|
int start = rs.getInt(5);
|
||||||
seasons.add(new LeagueSerie(type, format, maxMatches, start, end));
|
int end = rs.getInt(6);
|
||||||
|
seasons.add(new LeagueSerie(leagueType, type, format, maxMatches, start, end));
|
||||||
}
|
}
|
||||||
return seasons;
|
return seasons;
|
||||||
} finally {
|
} finally {
|
||||||
@@ -78,7 +79,7 @@ public class LeagueSerieDAO {
|
|||||||
try {
|
try {
|
||||||
Connection conn = _dbAccess.getDataSource().getConnection();
|
Connection conn = _dbAccess.getDataSource().getConnection();
|
||||||
try {
|
try {
|
||||||
PreparedStatement statement = conn.prepareStatement("select season_type, format, max_matches, start, end from league_season where league_type=? and start<=? and end>=?");
|
PreparedStatement statement = conn.prepareStatement("select league_type, season_type, format, max_matches, start, end from league_season where league_type=? and start<=? and end>=?");
|
||||||
try {
|
try {
|
||||||
statement.setString(1, league.getType());
|
statement.setString(1, league.getType());
|
||||||
statement.setInt(2, inTime);
|
statement.setInt(2, inTime);
|
||||||
@@ -86,12 +87,13 @@ public class LeagueSerieDAO {
|
|||||||
ResultSet rs = statement.executeQuery();
|
ResultSet rs = statement.executeQuery();
|
||||||
try {
|
try {
|
||||||
if (rs.next()) {
|
if (rs.next()) {
|
||||||
String type = rs.getString(1);
|
String leagueType = rs.getString(1);
|
||||||
String format = rs.getString(2);
|
String type = rs.getString(2);
|
||||||
int maxMatches = rs.getInt(3);
|
String format = rs.getString(3);
|
||||||
int start = rs.getInt(4);
|
int maxMatches = rs.getInt(4);
|
||||||
int end = rs.getInt(5);
|
int start = rs.getInt(5);
|
||||||
return new LeagueSerie(type, format, maxMatches, start, end);
|
int end = rs.getInt(6);
|
||||||
|
return new LeagueSerie(leagueType, type, format, maxMatches, start, end);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
package com.gempukku.lotro.db.vo;
|
package com.gempukku.lotro.db.vo;
|
||||||
|
|
||||||
public class LeagueSerie {
|
public class LeagueSerie {
|
||||||
|
private String _leagueType;
|
||||||
private String _type;
|
private String _type;
|
||||||
private String _format;
|
private String _format;
|
||||||
private int _maxMatches;
|
private int _maxMatches;
|
||||||
private int _start;
|
private int _start;
|
||||||
private int _end;
|
private int _end;
|
||||||
|
|
||||||
public LeagueSerie(String type, String format, int maxMatches, int start, int end) {
|
public LeagueSerie(String leagueType, String type, String format, int maxMatches, int start, int end) {
|
||||||
|
_leagueType = leagueType;
|
||||||
_type = type;
|
_type = type;
|
||||||
_format = format;
|
_format = format;
|
||||||
_maxMatches = maxMatches;
|
_maxMatches = maxMatches;
|
||||||
@@ -42,6 +44,7 @@ public class LeagueSerie {
|
|||||||
|
|
||||||
LeagueSerie that = (LeagueSerie) o;
|
LeagueSerie that = (LeagueSerie) o;
|
||||||
|
|
||||||
|
if (_leagueType != null ? !_leagueType.equals(that._leagueType) : that._leagueType != null) return false;
|
||||||
if (_type != null ? !_type.equals(that._type) : that._type != null) return false;
|
if (_type != null ? !_type.equals(that._type) : that._type != null) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -49,6 +52,12 @@ public class LeagueSerie {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return _type != null ? _type.hashCode() : 0;
|
int result = _leagueType != null ? _leagueType.hashCode() : 0;
|
||||||
|
result = 31 * result + (_type != null ? _type.hashCode() : 0);
|
||||||
|
result = 31 * result + (_format != null ? _format.hashCode() : 0);
|
||||||
|
result = 31 * result + _maxMatches;
|
||||||
|
result = 31 * result + _start;
|
||||||
|
result = 31 * result + _end;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
1x(S)TTT - Starter
|
||||||
|
6xTTT - Booster
|
||||||
|
2x4_249
|
||||||
|
1x4_356
|
||||||
Reference in New Issue
Block a user