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


Java Query.iterate方法代碼示例

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


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

示例1: loadInstructorAvailabilities

import org.hibernate.Query; //導入方法依賴的package包/類
private void loadInstructorAvailabilities(org.hibernate.Session hibSession, String puids) {
  	Query q = hibSession.createQuery("select distinct i.externalUniqueId, a from ClassInstructor ci inner join ci.instructor i inner join ci.classInstructing.assignments a " +
  			"where ci.lead = true and i.externalUniqueId in ("+puids+") and a.solution.owner.session.uniqueId=:sessionId and a.solution.commited=true and a.solution.owner.uniqueId not in ("+iSolverGroupIds+")");
  	q.setLong("sessionId",iSessionId.longValue());
for (Iterator i=q.iterate();i.hasNext();) {
	Object[] x = (Object[])i.next();
	String puid = (String)x[0];
	Assignment a = (Assignment)x[1];
	InstructorConstraint ic = (InstructorConstraint)iInstructors.get(puid);
	Placement p = a.getPlacement();
	ic.setNotAvailable(p);
	if (!iLectures.containsKey(a.getClassId())) {
		iLectures.put(a.getClassId(), p.variable());
		getModel().addVariable(p.variable());
	}
	
}
  }
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:19,代碼來源:TimetableDatabaseLoader.java

示例2: loadRoomAvailabilities

import org.hibernate.Query; //導入方法依賴的package包/類
private void loadRoomAvailabilities(org.hibernate.Session hibSession, String roomids) {
Query q = hibSession.createQuery("select distinct r.uniqueId, a from Location r inner join r.assignments as a "+
		"where r.uniqueId in ("+roomids+") and a.solution.owner.session.uniqueId=:sessionId and a.solution.commited=true and a.solution.owner.uniqueId not in ("+iSolverGroupIds+") and r.ignoreRoomCheck = false");
q.setLong("sessionId",iSessionId.longValue());
for (Iterator i=q.iterate();i.hasNext();) {
	Object[] x = (Object[])i.next();
	Long roomId = (Long)x[0];
	Assignment a = (Assignment)x[1];
	Placement p = a.getPlacement();
	RoomConstraint rc = (RoomConstraint)iRooms.get(roomId);
	rc.setNotAvailable(p);
	if (!iLectures.containsKey(a.getClassId())) {
		iLectures.put(a.getClassId(), p.variable());
		getModel().addVariable(p.variable());
	}
}
  }
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:18,代碼來源:TimetableDatabaseLoader.java


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