Merge pull request #103 in MIN/mineplex from feature/player-data to develop

* commit 'c2e88c27946e1b3870b71748a936469016e4158b':
  Updated to a better check
This commit is contained in:
Shaun Bennett 2015-12-18 17:33:47 -06:00
commit 453c3a65b6

View File

@ -73,30 +73,20 @@ public class CustomDataRepository extends RepositoryBase
for (CustomData cd : data.getDataMap().keySet()) for (CustomData cd : data.getDataMap().keySet())
{ {
if (executeUpdate(
executeInsert(UPDATE_DATA, new ResultSetCallable() UPDATE_DATA,
{
@Override
public void processResultSet(ResultSet resultSet) throws SQLException
{
if (!resultSet.isBeforeFirst())
{
// Not already in the DB
executeUpdate(
INSERT_DATA,
new ColumnInt("account", accountId),
new ColumnInt("customData", cd.getId()),
new ColumnInt("data", data.getDataMap().get(cd))
);
}
}
},
new ColumnInt("data", data.getDataMap().get(cd)), new ColumnInt("data", data.getDataMap().get(cd)),
new ColumnInt("account", accountId), new ColumnInt("account", accountId),
new ColumnInt("customData", cd.getId()) new ColumnInt("customData", cd.getId())) < 1)
); {
// Not already in the DB
executeUpdate(
INSERT_DATA,
new ColumnInt("account", accountId),
new ColumnInt("customData", cd.getId()),
new ColumnInt("data", data.getDataMap().get(cd))
);
}
} }
} }