Quantcast
Channel: PTC Community : Unanswered Discussions - Windchill
Viewing all articles
Browse latest Browse all 3592

Query object through API

$
0
0

Hi! I qant to query object through windchill api like this:

 

QuerySpec qs = new QuerySpec(WTDocument.class);

                    qs.setAdvancedQueryEnabled(true);

                    int ind = qs.appendClassList(WTDocument.class,true);

                    SearchCondition sc = new SearchCondition(WTDocument.class, WTDocument.NUMBER, SearchCondition.LIKE, "173.157.%");

                    SearchCondition sc2 = new SearchCondition(WTDocument.class, WTDocument.FOLDERING_INFO, SearchCondition.LIKE, "folderName");

                    qs.appendWhere(sc, new int[ind]);

                    qs.appendAnd();

                    qs.appendWhere(sc2, new int[ind]);

                    QueryResult qr =  PersistenceHelper.manager.find(qs);

                    while (qr.hasMoreElements())

                    {

                              WTDocument doc = (WTDocument)qr.nextElement();

                              System.out.println(doc.getNumber());

                    }

 

But I have an exception that attribute "folderingInfo" is not the member of the wt.doc.WTDocument class.

Whats wrong? How can I create the complex query with a lot of searchConditions?


Viewing all articles
Browse latest Browse all 3592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>