當前位置: 首頁>>代碼示例>>Java>>正文


Java Where.in方法代碼示例

本文整理匯總了Java中com.j256.ormlite.stmt.Where.in方法的典型用法代碼示例。如果您正苦於以下問題:Java Where.in方法的具體用法?Java Where.in怎麽用?Java Where.in使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.j256.ormlite.stmt.Where的用法示例。


在下文中一共展示了Where.in方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getLastDialogNotificationByDialogId

import com.j256.ormlite.stmt.Where; //導入方法依賴的package包/類
public DialogNotification getLastDialogNotificationByDialogId(List<Long> dialogOccupantsList) {
    DialogNotification dialogNotification = null;

    try {
        QueryBuilder<DialogNotification, Long> queryBuilder = dao.queryBuilder();
        Where<DialogNotification, Long> where = queryBuilder.where();
        where.in(DialogOccupant.Column.ID, dialogOccupantsList);
        queryBuilder.orderBy(DialogNotification.Column.CREATED_DATE, false);
        PreparedQuery<DialogNotification> preparedQuery = queryBuilder.prepare();
        dialogNotification = dao.queryForFirst(preparedQuery);
    } catch (SQLException e) {
        ErrorUtils.logError(e);
    }

    return dialogNotification;
}
 
開發者ID:QuickBlox,項目名稱:q-municate-android,代碼行數:17,代碼來源:DialogNotificationDataManager.java

示例2: getLastMessageByDialogId

import com.j256.ormlite.stmt.Where; //導入方法依賴的package包/類
public Message getLastMessageByDialogId(List<Long> dialogOccupantsList) {
    Message message = null;

    try {
        QueryBuilder<Message, Long> queryBuilder = dao.queryBuilder();
        Where<Message, Long> where = queryBuilder.where();
        where.in(DialogOccupant.Column.ID, dialogOccupantsList);
        queryBuilder.orderBy(Message.Column.CREATED_DATE, false);
        PreparedQuery<Message> preparedQuery = queryBuilder.prepare();
        message = dao.queryForFirst(preparedQuery);
    } catch (SQLException e) {
        ErrorUtils.logError(e);
    }

    return message;
}
 
開發者ID:QuickBlox,項目名稱:q-municate-android,代碼行數:17,代碼來源:MessageDataManager.java

示例3: getQueryIdsForOrg

import com.j256.ormlite.stmt.Where; //導入方法依賴的package包/類
protected void getQueryIdsForOrg(MitroRequestContext context, int orgId, Set<Integer> userIds, Set<Integer> secretIds, Set<Integer> groupIds)
    throws MitroServletException, SQLException {
  // TODO: We need to create an API for orgs and clean this up.
  @SuppressWarnings("deprecation")
  AuthenticatedDB userDb = AuthenticatedDB.deprecatedNew(context.manager, context.requestor);
  if (!userDb.isOrganizationAdmin(orgId)) {
    throw new MitroServletException("Not org or no access");
  }

  RPC.GetOrganizationStateResponse out = GetOrganizationState.doOperation(context,  orgId);

  userIds.clear();

  // TODO: change GetOrganizationState query to return the user id column.
  if (!out.members.isEmpty()) {
    QueryBuilder<DBIdentity, Integer> query = context.manager.identityDao.queryBuilder();
    query.selectColumns(DBIdentity.ID_NAME);
    Where<DBIdentity, Integer> where = query.where();
    where.in(DBIdentity.NAME_FIELD_NAME, Manager.makeSelectArgsFromList(out.members));

    for (DBIdentity identity : query.query()) {
      userIds.add(identity.getId());
    }
  }

  secretIds.clear();
  secretIds.addAll(out.orgSecretsToPath.keySet());
  secretIds.addAll(out.orphanedSecretsToPath.keySet());

  groupIds.clear();
  groupIds.addAll(out.groups.keySet());
}
 
開發者ID:WeAreWizards,項目名稱:passopolis-server,代碼行數:33,代碼來源:GetAuditLog.java

示例4: testTwoResultsInSubQuery

import com.j256.ormlite.stmt.Where; //導入方法依賴的package包/類
@Test(expected = SQLException.class)
public void testTwoResultsInSubQuery() throws Exception {
	BaseDaoImpl<ForeignFoo, Integer> foreignDao =
			new BaseDaoImpl<ForeignFoo, Integer>(connectionSource, ForeignFoo.class) {
			};
	QueryBuilder<ForeignFoo, Integer> qbInner = foreignDao.queryBuilder();
	qbInner.selectColumns(ID_COLUMN_NAME);
	QueryBuilder<ForeignFoo, Integer> qbOuter = foreignDao.queryBuilder();
	qbInner.selectColumns(FOREIGN_COLUMN_NAME);

	Where<ForeignFoo, Integer> where = qbOuter.where();
	where.in(ID_COLUMN_NAME, qbInner);
	where.prepare();
}
 
開發者ID:j256,項目名稱:ormlite-core,代碼行數:15,代碼來源:InSubQueryTest.java

示例5: testResultColumnNoMatchWhere

import com.j256.ormlite.stmt.Where; //導入方法依賴的package包/類
@Test(expected = SQLException.class)
public void testResultColumnNoMatchWhere() throws Exception {
	BaseDaoImpl<ForeignFoo, Integer> foreignDao =
			new BaseDaoImpl<ForeignFoo, Integer>(connectionSource, ForeignFoo.class) {
			};
	QueryBuilder<ForeignFoo, Integer> qbInner = foreignDao.queryBuilder();
	qbInner.selectColumns(STRING_COLUMN_NAME);
	QueryBuilder<ForeignFoo, Integer> qbOuter = foreignDao.queryBuilder();
	Where<ForeignFoo, Integer> where = qbOuter.where();
	where.in(ID_COLUMN_NAME, qbInner);
	where.prepare();
}
 
開發者ID:j256,項目名稱:ormlite-core,代碼行數:13,代碼來源:InSubQueryTest.java


注:本文中的com.j256.ormlite.stmt.Where.in方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。