本文整理汇总了Java中org.activiti.engine.identity.UserQuery.singleResult方法的典型用法代码示例。如果您正苦于以下问题:Java UserQuery.singleResult方法的具体用法?Java UserQuery.singleResult怎么用?Java UserQuery.singleResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.identity.UserQuery
的用法示例。
在下文中一共展示了UserQuery.singleResult方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testQueryByFirstName
import org.activiti.engine.identity.UserQuery; //导入方法依赖的package包/类
public void testQueryByFirstName() {
UserQuery query = identityService.createUserQuery().userFirstName("Gonzo");
verifyQueryResults(query, 1);
User result = query.singleResult();
assertEquals("gonzo", result.getId());
}
示例2: testQueryByLastName
import org.activiti.engine.identity.UserQuery; //导入方法依赖的package包/类
public void testQueryByLastName() {
UserQuery query = identityService.createUserQuery().userLastName("Bear");
verifyQueryResults(query, 1);
User result = query.singleResult();
assertEquals("fozzie", result.getId());
}
示例3: testQueryByMemberOf
import org.activiti.engine.identity.UserQuery; //导入方法依赖的package包/类
public void testQueryByMemberOf() {
UserQuery query = identityService.createUserQuery().memberOfGroup("muppets");
verifyQueryResults(query, 3);
query = identityService.createUserQuery().memberOfGroup("frogs");
verifyQueryResults(query, 1);
User result = query.singleResult();
assertEquals("kermit", result.getId());
}
示例4: verifySingleResultFails
import org.activiti.engine.identity.UserQuery; //导入方法依赖的package包/类
private void verifySingleResultFails(UserQuery query) {
try {
query.singleResult();
fail();
} catch (ActivitiException e) {}
}