0

我有如下查询,

/rest-1.v1/Data/TeamRoom?sel=Name,Team,Participants.@Count&where=Team='Team:4250032'

我如何从 VersionOne Java SDK 做同样的事情?

4

1 回答 1

1

Found the answer.

IAssetType assetType = _metaModel.getAssetType("TeamRoom");
Query query = new Query(assetType);
IAttributeDefinition team = assetType.getAttributeDefinition("Team");
IAttributeDefinition name = assetType.getAttributeDefinition("Name");
IAttributeDefinition count = assetType.getAttributeDefinition("Participants.@Count");
IFilterTerm teamName = new TokenTerm("Team='Team:4250032'");
query.getSelection().add(team);
query.getSelection().add(name);
query.getSelection().add(count);
query.setFilter(teamName);

QueryResult result = _services.retrieve(query);
于 2014-10-27T21:07:27.413 回答