Closed averbraeck closed 9 months ago
Changes have been made, but code still has to be tested. Especially the joins for the tables for house in HouseRound and MeasureType and PlayerRound in Measure are tricky. As an example:
.addEntry(new TableEntryPickRecord(Tables.MEASURE.MEASURETYPE_ID)
.setPickTable(data, Tables.MEASURE.join(Tables.MEASURETYPE)
.on(Tables.MEASURE.MEASURETYPE_ID.eq(Tables.MEASURETYPE.ID))
.and(Tables.MEASURE.HOUSEROUND_ID.eq(houseRoundId)),
Tables.MEASURE.ID, Tables.MEASURETYPE.NAME)
.setRequired()
.setInitialValue(measure.getMeasuretypeId(), 0)
.setLabel("Measure type"))
.addEntry(new TableEntryPickRecord(Tables.MEASURE.PLAYERROUND_ID)
.setPickTable(data, Tables.MEASURE.join(Tables.PLAYERROUND)
.on(Tables.MEASURE.PLAYERROUND_ID.eq(Tables.PLAYERROUND.ID))
.and(Tables.MEASURE.HOUSEROUND_ID.eq(houseRoundId))
.join(Tables.PLAYER).on(Tables.PLAYERROUND.PLAYER_ID.eq(Tables.PLAYER.ID)),
Tables.MEASURE.ID, Tables.PLAYER.CODE)
.setRequired()
.setInitialValue(measure.getMeasuretypeId(), 0)
.setLabel("Player"))
In the end, the selection of a house_id
for the houseround
table was simplified by using a direct SQL query:
.addEntry(new TableEntryPickRecord(Tables.HOUSEROUND.HOUSE_ID).setPickTable(data,
dslContext.fetch("SELECT * from HOUSE INNER JOIN community ON house.community_id = community.id "
+ "WHERE community.gameversion_id = " + gameSession.getGameversionId()
+ " AND house.available_round <= " + groupRound.getRoundNumber()),
Tables.HOUSE.ID, Tables.HOUSE.CODE)
Admin app adapted to changes.
The database has a new
houseround
table that replaces thebid
table. The code needs to reflect these changes. See https://github.com/averbraeck/housinggame-common/issues/4 for the design information.The
measure
table points to thishouseround
table instead of to thehouse
table. This has to be changed as well.