赞
踩
public void addCarmera(Carmera carmera)throws SystemException , CommPlatException{ //获取一个id号 Session session=null; // // long equipmentId = CounterLocalServiceUtil.increment(Carmera.class.getName()); String sql="SELECT top 1 * FROM res_carmera order by picNum desc"; session = HibernateUtil.openSession(); SQLQuery q=session.createSQLQuery(sql); q.addEntity("res_carmera", CarmeraImpl.class); Carmera ca=(Carmera) q.list().get(0); long picnum = Long.parseLong(ca.getPicNum())+1; // picNum :图像编号 long placeNum=Long.parseLong(ca.getPlaceNum())+1;//placeNum : 点位编号 carmera.setPicNum(String.valueOf(picnum)); carmera.setPlaceNum(String.valueOf(placeNum)); carmera.setNew(true); carmera.setPrimaryKey(equipmentId); CarmeraUtil.update(carmera,true); }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。