Skip to content

Commit

Permalink
fix condition name saving to SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol authored and nicol committed Nov 17, 2024
1 parent fc24d2a commit ddb424d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ public void saveOrUpdateCardStock(MTGCardStock state) throws SQLException {
if (state.getId() < 0) {
logger.debug("save stock {}",state);
try (var c = pool.getConnection(); var pst = c.prepareStatement( "insert into stocks ( conditions,foil,signedcard,langage,qte,comments,idmc,collection,mcard,altered,price,grading,tiersAppIds,etched,idMe,dateUpdate,name) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Statement.RETURN_GENERATED_KEYS)) {
pst.setString(1, String.valueOf(state.getCondition()));
pst.setString(1, state.getCondition().name());
pst.setBoolean(2, state.isFoil());
pst.setBoolean(3, state.isSigned());
pst.setString(4, state.getLanguage());
Expand Down Expand Up @@ -1625,7 +1625,7 @@ public void saveOrUpdateCardStock(MTGCardStock state) throws SQLException {
try (var c = pool.getConnection(); var pst = c.prepareStatement(
"update stocks set comments=?, conditions=?, foil=?,signedcard=?,langage=?, qte=? ,altered=?,price=?,idmc=?,collection=?,grading=?,tiersAppIds=?,etched=?, mcard=?, idMe=?, dateUpdate=?, name=? where idstock=?")) {
pst.setString(1, state.getComment());
pst.setString(2, state.getCondition().toString());
pst.setString(2, state.getCondition().name());
pst.setBoolean(3, state.isFoil());
pst.setBoolean(4, state.isSigned());
pst.setString(5, state.getLanguage());
Expand Down

0 comments on commit ddb424d

Please sign in to comment.