" SET parent_id = ?, mod_metadata = ?, change_date = ? WHERE " + (DebugConfig.enableMailboxGroup ? "mailbox_id = ? AND " : "") + relation);
" SET parent_id = ?, mod_metadata = ?, change_date = ?" + " WHERE " + IN_THIS_MAILBOX_AND + relation);
    public static void reparentChildren(MailItem oldParent, MailItem newParent) throws ServiceException {    	if (oldParent == newParent)    		return;        Mailbox mbox = oldParent.getMailbox();    	if (mbox != newParent.getMailbox())    		throw MailServiceException.WRONG_MAILBOX();        Connection conn = mbox.getOperationConnection();		PreparedStatement stmt = null;        try {            String relation = (oldParent instanceof VirtualConversation ? "id = ?" : "parent_id = ?");            stmt = conn.prepareStatement("UPDATE " + getMailItemTableName(oldParent) +                    " SET parent_id = ?, mod_metadata = ?, change_date = ? WHERE " +                    (DebugConfig.enableMailboxGroup ? "mailbox_id = ? AND " : "") +                    relation);            int pos = 1;            if (newParent instanceof VirtualConversation)                stmt.setNull(pos++, Types.INTEGER);            else                stmt.setInt(pos++, newParent.getId());            stmt.setInt(pos++, mbox.getOperationChangeID());            stmt.setInt(pos++, mbox.getOperationTimestamp());            if (DebugConfig.enableMailboxGroup)                stmt.setInt(pos++, mbox.getId());            stmt.setInt(pos++, oldParent instanceof VirtualConversation ? ((VirtualConversation) oldParent).getMessageId() : oldParent.getId());            stmt.executeUpdate();        } catch (SQLException e) {        	throw ServiceException.FAILURE("writing new parent for children of item " + oldParent.getId(), e);        } finally {        	DbPool.closeStatement(stmt);        }    }