data.modMetadata = mbox.getOperationChangeID(); data.modContent  = mbox.getOperationChangeID();
data.contentChanged(mbox);
    static SearchFolder create(int id, Folder parent, String name, String query, String types, String sort) throws ServiceException {        if (parent == null || !parent.canContain(TYPE_SEARCHFOLDER))            throw MailServiceException.CANNOT_CONTAIN();        name = validateFolderName(name);        query = validateQuery(query);        if (parent.findSubfolder(name) != null)            throw MailServiceException.ALREADY_EXISTS(name);        if (types != null && types.trim().equals(""))            types = null;        if (sort != null && sort.trim().equals(""))            sort = null;        Mailbox mbox = parent.getMailbox();        UnderlyingData data = new UnderlyingData();        data.id          = id;        data.type        = TYPE_SEARCHFOLDER;        data.folderId    = parent.getId();        data.parentId    = parent.getId();        data.date        = mbox.getOperationTimestamp();        data.subject     = name;        data.metadata    = encodeMetadata(query, types, sort);        data.modMetadata = mbox.getOperationChangeID();        data.modContent  = mbox.getOperationChangeID();        DbMailItem.create(mbox, data);                SearchFolder search = new SearchFolder(mbox, data);        search.finishCreation(parent);        return search;    }