@Override public void insertToDb(NamedPreparedStatement s, PlayerShortcut val) throws SQLException { if (val instanceof ItemShortcut) { s.setString("type", "item"); s.setInt("item_uid", ((ItemShortcut) val).getItemUid()); } else if (val instanceof SpellShortcut) { s.setString("type", "spell"); s.setInt("spell_id", ((SpellShortcut) val).getSpellId()); } }
@Override public void setPrimaryKeys(NamedPreparedStatement s, PlayerShortcut val) throws SQLException { s.setInt("player_id", val.getPlayerId()); s.setInt("slot", val.getSlot()); s.setByte("bar_type", val.getBarType().value); }