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

QuerySpec for Local/Standard Attributes

Highlighted
Regular Member

QuerySpec for Local/Standard Attributes

I created a local/standard attribute of type string. I'm trying fetch it's value through query spec but getting the following error:

2019-04-16 20:53:05,092 INFO [ajp-nio-127.0.0.1-8011-exec-5] wt.system.err pjai12 - wt.query.QueryException: Attribute "ptc_str_89typeInfoLCSProduct" is not a member of class "class com.lcs.wc.product.LCSSKU"
2019-04-16 20:53:05,092 INFO [ajp-nio-127.0.0.1-8011-exec-5] wt.system.err pjai12 - Nested exception is: Attribute "ptc_str_89typeInfoLCSProduct" is not a member of class "class com.lcs.wc.produ

 

Here is my code:

String sampleSizeTestNoColumnName = ((product.getFlexType())
.getAttribute(ConverseConstants.SAMPLE_SIZE_FIT_SIZE_NUMBER)).getColumnName();

QuerySpec qs = new QuerySpec(); 
int classIndex = qs.appendClassList(com.lcs.wc.product.LCSSKU.class, false); 
ClassAttribute ca = new ClassAttribute(
com.lcs.wc.product.LCSSKU.class, sampleSizeTestNoColumnName);
qs.appendSelect(ca, new int[] { classIndex }, false);
QueryResult qr = PersistenceHelper.manager.find(qs);

while (qr.hasMoreElements()){
System.out.println("Element is: "+qr.nextElement());
}

QuerySpec doesn't work for Standard/Local attributes? If yes then what's the other way?