Package org.hibernate

Examples of org.hibernate.Query.iterate()


    if (orderBy != null)
      sb.append(" Order By ").append(orderBy);
    try {
      Query query = session.createQuery(sb.toString());
      query.setLockMode("this", lockMode);
      return query.iterate();
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
View Full Code Here


      sb.append(" Where ").append(condition);
    if (orderBy != null)
      sb.append(" Order By ").append(orderBy);
    try {
      Query query = session.createQuery(sb.toString());
      return query.iterate();
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
View Full Code Here

    if (orderBy != null)
      sb.append(" Order By ").append(orderBy);
    try {
      Query query = session.createQuery(sb.toString());
      query.setLockMode("this", lockMode);
      return query.iterate();
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
View Full Code Here

      sb.append(" Where ").append(condition);
    if (orderBy != null)
      sb.append(" Order By ").append(orderBy);
    try {
      Query query = session.createQuery(sb.toString());
      return query.iterate();
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
View Full Code Here

    if (orderBy != null)
      sb.append(" Order By ").append(orderBy);
    try {
      Query query = session.createQuery(sb.toString());
      query.setLockMode("this", lockMode);
      return query.iterate();
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
View Full Code Here

          public Object doInHibernate(Session session)
              throws HibernateException {
            Query query = session
                .createQuery("select count(*) from ApplicationUser applicationUser where exists(select 1 from UserRole userRole  where userRole.applicationUser=applicationUser and userRole.userType=:userType)");
            query.setParameter("userType", userType);
            return ((Integer) query.iterate().next()).intValue();

          }

        });
  }
View Full Code Here

                    query.setParameter("transportFrom", querySettings.getTransportFrom()).setParameter(
                            "transportTo", querySettings.getTransportTo());
                    break;
                }

                return query.iterate().next();
            }

        });
    }
View Full Code Here

    logger.info("start history updating for all processes");
    try {
      Session session = Helper.getHibernateSession();
      Query query = session.createQuery("from Prozess order by id desc");
      @SuppressWarnings("unchecked")
      Iterator<Prozess> it = query.iterate();
      int i = 0;
      while (it.hasNext()) {
        i++;
        Prozess proc = it.next();
        logger.debug("updating history entries for " + proc.getTitel());
View Full Code Here

    s.clear();
    Query q = s.createQuery("select distinct a.zoo from Animal a where a.zoo is not null");
    Type type = q.getReturnTypes()[0];
    assertTrue( type instanceof ManyToOneType );
    assertEquals( ( (ManyToOneType) type ).getAssociatedEntityName(), "org.hibernate.test.hql.Zoo" );
    zoo = (Zoo) q
      .iterate().next();
    assertEquals( zoo.getMammals().size(), 1 );
    assertEquals( zoo.getAnimals().size(), 1 );
    s.clear();
    s.delete(plat);
View Full Code Here

    public SyntaxChecker checkIterate() {
      Session s = openSession();
      s.beginTransaction();
      Query query = s.createQuery( hql );
      preparer.prepare( query );
      query.iterate();
      s.getTransaction().commit();
      s.close();
      return this;
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.