public AccountInventory useAccount(String name) throws ApiSenderException { SimpleQuery<AccountVO> q = dbf.createQuery(AccountVO.class); q.add(AccountVO_.name, Op.EQ, name); AccountVO vo = q.find(); DebugUtils.Assert(vo != null, String.format("cannot find account[name:%s]", name)); account = AccountInventory.valueOf(vo); accountSession = api.loginByAccount(name, vo.getPassword()); return account; }