Solution for search object with IBA Attribute

        QuerySpec qs = new QuerySpec(WTDocument.class);

        // IBA attribute area. I used one IBA value "ALEX1" 

        AttributeDefDefaultView addv = IBADefinitionHelper.service.getAttributeDefDefaultViewByPath("ALEX1");
        long ibaDefId = addv.getObjectID().getId();
        IBAQuerySpec ibaQuery = new IBAQuerySpec(StringValue.class);
        ibaQuery.addCondition(new Long(ibaDefId), SearchCondition.EQUAL, "ALEX001");
        
        ibaQuery.doSearchCondition(qs, WTDocument.class);
        
        LatestConfigSpec latestCSpec = new LatestConfigSpec();
        qs = latestCSpec.appendSearchCriteria(qs); 

        System.out.println(qs);
        QueryResult qr = PersistenceHelper.manager.find(qs);
        

        System.out.println("qr size is: "+qr.size());
        
        Persistable[] perArray = (Persistable[]) qr.nextElement();
        System.out.println(perArray[0]);

 

你可能感兴趣的:(attribute)