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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

using QuerySpect to access Referenced objects

talan
1-Newbie

using QuerySpect to access Referenced objects

Given an object that has an attribute in an Object: private ObjectReference iptTeamCodeReference; how does one join the referenced object into the query? the following seems right, but gets an exception: qs.appendSelectReference(new ClassAttribute(TheChangeOrder.class, TheChangeOrder.IPT_TEAM_CODE_REFERENCE), new ClassAttribute(TheTeamCode.class, theTeamCode.IPT_NUMBER), changeOrderIndex, teamCodeIndex, false); Introspection Runtime Mode = true wt.query.QueryException Nested exception is: Attribute "iptTeamCodeReference" is not a member of class " class ext.xxx.TheChangeOrder"; nested exception is: (wt.pom.pomResource/0) wt.pom.PersistenceException: A persistence error occurred. System message follows: Nested exception is: (wt.introspection.introspectionResource/2) wt.introspection .WTIntrospectionException: iptTeamCodeReference column not found for TheChangeOr der. Which is very odd because the attribute is a member of the class.
1 REPLY 1

I don't believe you can get to the attribute you want using that method. That method signature requires that the two ClassAttributes or ColumnExpressions return a classname and id value. It may be that you have to return the entire TeamCode object in the result set and then as you are processing the results you have to get the object from the results then get the number from the TeamCode object. You could try do something along these lines using the method you were trying to use.
ff2c5c04cd
Top Tags