cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

QuerySpec for searching on a specific soft type?

tbusch
1-Newbie

QuerySpec for searching on a specific soft type?

Hey guys,

Any idea how to write a QuerySpec SearchCondition which will filter my results based on a specific soft type?

Something like this:
QuerySpec mySpec = new QuerySpec(WTDocument.class);
mySpec.appendWhere(new SearchCondition(WTDocument.class, WTDocument.BUSINESS_TYPE, SearchCondition.LIKE, "MySoftType"));
mySpec.appendAnd();
mySpec.appendWhere(new SearchCondition(WTDocument.class,WTDocument.LATEST_ITERATION, SearchCondition.IS_TRUE ));
QueryResult myTempQr = PersistenceHelper.manager.find(mySpec);

Except that this example gives me this error:

Attribute "businessType" is not a member of class "class wt.doc.WTDocument"

This is a similar error to what I get if I try WTDocument.DISPLAY_TYPE or WTDocument.DOC_TYPE.

Thanks for your time!

-Thomas R. Busch
Sr. Software Developer
Stryker Instruments
(269) 323-7700 x4014
tom.busch@stryker.com<">mailto:tom.busch@stryker.com>


This email, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this email is not the intended recipient or their authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this email in error, please notify the sender by replying to this message and deleting the email immediately.
3 REPLIES 3

Hi,

The conditions to add a softtype condition would be like this

SearchCondition sc1 = new SearchCondition(WTDocument.class,
Typed.TYPE_DEFINITION_REFERENCE + "."
+ WTAttributeNameIfc.REF_OBJECT_ID,
WTTypeDefinition.class, WTAttributeNameIfc.ID_NAME);
SearchCondition sc2 = new SearchCondition(
WTTypeDefinitionMaster.class,
WTTypeDefinitionMaster.INT_HID,
SearchCondition.EQUAL,
<logical_identifier_of_the_softtype>);


This will work.

Praseeth M
+91-9176687882


tbusch
1-Newbie
(To:tbusch)

Do I have to add WTTypeDefinitionMaster in a join or from clause?

-Thomas R. Busch
Sr. Software Developer
Stryker Instruments
(269) 323-7700 x4014
tom.busch@stryker.com<">mailto:tom.busch@stryker.com>

you will need to add typedefinitionmaster.class in

querySpec.addclasslist()



Praseeth M
Top Tags