" WHERE " + (DebugConfig.enableMailboxGroup ? "mailbox_id = ? AND " : "") + "id = ?");
" WHERE " + IN_THIS_MAILBOX_AND + "id = ?");
    public static void imove(MailItem item, boolean shared, Folder folder, int imapId) throws ServiceException {        Mailbox mbox = item.getMailbox();        if (folder == null || imapId == 0)            throw ServiceException.FAILURE("invalid data for DB item copy", null);        Connection conn = mbox.getOperationConnection();        PreparedStatement stmt = null;        try {            String table = getMailItemTableName(item);            String flags = shared ? "flags = flags | " + Flag.BITMASK_COPIED + ", " : "";            stmt = conn.prepareStatement("UPDATE " + table +                    " SET folder_id = ?, " + flags + "imap_id = ?, mod_metadata = ?, change_date = ?" +                    " WHERE " + (DebugConfig.enableMailboxGroup ? "mailbox_id = ? AND " : "") + "id = ?");            int pos = 1;            stmt.setInt(pos++, folder.getId());            stmt.setInt(pos++, imapId);            stmt.setInt(pos++, mbox.getOperationChangeID());            stmt.setInt(pos++, mbox.getOperationTimestamp());            if (DebugConfig.enableMailboxGroup)                stmt.setInt(pos++, mbox.getId());            stmt.setInt(pos++, item.getId());            stmt.executeUpdate();        } catch (SQLException e) {            throw ServiceException.FAILURE("i-moving " + MailItem.getNameForType(item.getType()) + ": " + item.getId(), e);        } finally {            DbPool.closeStatement(stmt);        }    }