Example usage for javax.persistence Query getResultList

List of usage examples for javax.persistence Query getResultList

Introduction

In this page you can find the example usage for javax.persistence Query getResultList.

Prototype

List getResultList();

Source Link

Document

Execute a SELECT query and return the query results as an untyped List.

Usage

From source file:com.exp.tracker.services.impl.JpaRoleService.java

@SuppressWarnings("unchecked")
@Transactional(readOnly = true)/*from w w w . j  a  v  a 2 s  . c  o m*/
public List<RoleEntity> getRoles() {
    Query queryGetRoles = em.createNamedQuery("getRoles");
    return queryGetRoles.getResultList();
}

From source file:com.tamnd2.basicwebapp.core.repositories.jpa.JpaBlogRepo.java

@Override
public List<Blog> findAllBlogs() {
    Query query = em.createQuery("SELECT b from Blog b");
    return query.getResultList();
}

From source file:com.consol.citrus.samples.flightbooking.persistence.impl.CustomerDaoImpl.java

@SuppressWarnings("unchecked")
public List<Customer> findAll() {
    Query query = em.createQuery("from CustomerEntity c");

    return query.getResultList();
}

From source file:com.linksinnovation.elearning.repository.CourseDTORepository.java

public List<CourseDTO> findAll() {
    String queryString = query + " WHERE status = 'PUBLISH'";
    Query q = em.createNativeQuery(queryString);
    return mapObject(q.getResultList());
}

From source file:org.mifos.user.repository.StandardOfficeDao.java

@Override
@Transactional(readOnly = true)//from  ww w. j av  a 2 s  . com
public List<Office> getAll() {
    Query query = entityManager.createQuery("from Office");
    return query.getResultList();
}

From source file:bc8.movies.dao.MovieDaoImpl.java

public List<Movie> getMovies() {
    Query query = em.createQuery("select movie from Movie movie");

    return query.getResultList();
}

From source file:br.estacio.profissoes.daoimplementacao.AlunoDAOImplementacao.java

@Override
public List<Aluno> listarTodos() {
    Query query = entityManager.createQuery("select a from Aluno a");
    return query.getResultList();
}

From source file:dao.UsuarioDao.java

public List<Usuario> consultarTodosUsuarios() {
    EntityManagerFactory factory = Persistence.createEntityManagerFactory("LoginUsersPU");
    EntityManager em = factory.createEntityManager();

    em.getTransaction().begin();/*from ww  w. j  a  v a 2  s .  co m*/
    Query q = em.createNamedQuery("Usuario.findAll");
    List<Usuario> todosUsuarios = q.getResultList();
    return todosUsuarios;
}

From source file:bc8.movies.dao.ActorDaoImpl.java

public List<Actor> getAllActors() {
    Query query = em.createQuery("select actor from Actor actor");
    return query.getResultList();
}

From source file:mz.inolabdev.rh.dao.impl.LicenceDaoImpl.java

@SuppressWarnings("unchecked")
@Override//from  w w  w  .  j  a  va2  s.  c  o m
public List<License> findByStatus(String status) {

    Query query = em.createQuery("select l from License l where l.status like '" + status + "'");

    return query.getResultList();
}