HQL 取出对象转型

		String hqls1 = "select a.totalLength from AutoTotallenCalc a where a.lineName = '"
				+ lineone + "'";
		List s1 = tools.bo.query(hqls1);
		int num1 = s1.size();
		float lgs1 = 0;
		for (int n = 0; n < num1; n++) {
			Object atc = (Object) s1.get(n);
			Float lm = (Float) atc;
			lgs1 += lm.floatValue();
		}

 

		AutoTotallenCalcForm acf = (AutoTotallenCalcForm) form;
		acf.setFirstnum(Integer.toString(num1));
		acf.setFirstlens(Float.toString(lgs1));
		

 

你可能感兴趣的:(HQL 取出对象转型)