public List<TemporaryRecovery> getTemporaryRecovery() { List<TemporaryRecovery> list = new ArrayList<TemporaryRecovery>(); session = HibernateUtil.getSessionFactory().openSession(); list = session .createCriteria(TemporaryRecovery.class) .add(Restrictions.eq("direction", ii.getDirection())) .add(Restrictions.eq("line", ii.getLine())) .add(Restrictions.eq("railThread", ii.getRailThread())) .add( Restrictions.between( "coordinate", ii.getKmS() * 1000 + ii.getmS(), ii.getKmE() * 1000 + ii.getmE())) .list(); session.close(); return list; }
public List<RailsDefect> getRailsDefectList() { List<RailsDefect> list = null; session = HibernateUtil.getSessionFactory().openSession(); list = session .createCriteria(RailsDefect.class) .add(Restrictions.eq("direction", ii.getDirection())) .add(Restrictions.eq("line", ii.getLine())) .add(Restrictions.eq("railThread", ii.getRailThread())) .add( Restrictions.between( "coordinate", ii.getKmS() * 1000 + ii.getmS(), ii.getKmE() * 1000 + ii.getmE())) .list(); session.close(); return list; }
public List<RailsStrings> getRailsStrings() { List<RailsStrings> list = null; session = HibernateUtil.getSessionFactory().openSession(); Criterion cr1 = Restrictions.le("startCoordinate", ii.getKmE() * 1000 + ii.getmE()); Criterion cr2 = Restrictions.ge("endCoordinate", ii.getKmS() * 1000 + ii.getmS()); list = session .createCriteria(RailsStrings.class) .add(Restrictions.eq("direction", ii.getDirection())) .add(Restrictions.eq("line", ii.getLine())) .add(Restrictions.eq("railThread", ii.getRailThread())) .add(Restrictions.and(cr1, cr2)) .list(); session.close(); return list; }