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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Find global attribute definition id

VasiliyRepecki
12-Amethyst

Find global attribute definition id

Hi.

How to find global attribute definition id by logical identifier?

I'm trying to use next code:

/* attributeId is Logical Identifier of my global attribute */

long IBABooleanDefinitionId = 0;

BooleanDefinition booleanDefinition;

QuerySpec querySpec = new QuerySpec(BooleanDefinition.class);

CompositeWhereExpression whereExpression = new CompositeWhereExpression(LogicalOperator.AND);

whereExpression.append(new SearchCondition(BooleanDefinition.class, WTTypeDefinition.LOGICAL_IDENTIFIER, SearchCondition.EQUAL, attributeId), new int[]{0});

querySpec.appendWhere(whereExpression, new int[]{0});

QueryResult queryResult = PersistenceHelper.manager.find((StatementSpec) querySpec);

if(queryResult.hasMoreElements())

{

booleanDefinition = (BooleanDefinition) queryResult.nextElement();

IBABooleanDefinitionId = booleanDefinition.getPersistInfo().getObjectIdentifier().getId();

}

I have wt.query.QueryException that "logicalIdentifier" does not belongs to class wt.iba.definition.BooleanDefinition

Ok, but i cannot find field "logicalIdentifier" in BooleanDefinition though Logical Identifier textfield exists in global attribute creation form.

How should i fix my code?

Thanks.

0 REPLIES 0
Announcements


Top Tags