// Implement your query specification QuerySpec spec = new QuerySpec(WTDocument.class); spec.appendWhere(new SearchCondition(WTDocument.class, WTDocument.NAME, SearchCondition.EQUAL,"JUN_DOC2")); // Set latest configspec LatestConfigSpec configspec = new LatestConfigSpec(); // Search latest object. Do not use PersistenceHelper.manager.find(). QueryResult result = ConfigHelper.service.queryIterations(spec, configspec); Enumeration resultEnum = result.getEnumeration(); while( resultEnum.hasMoreElements() ) { WTDocument part = (WTDocument)resultEnum.nextElement(); System.out.println("--------------------------"); System.out.println("NAME="+part.getName()); //System.out.println("VIEW="+part.getViewName()); System.out.println(part.getVersionIdentifier().getValue()); System.out.println(part.getIterationIdentifier().getValue()); //System.out.println(((WTDocument)lObject.getLatest()).getViewName()); }
Solution for searching the latest revision object
猜你喜欢
转载自felixli.iteye.com/blog/1388722
今日推荐
周排行