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:org.kuali.mobility.xsl.dao.XslDaoImpl.java

@SuppressWarnings("unchecked")
public List<Xsl> findAllXsl() {
    Query query = entityManager.createQuery("select x from Xsl x order by x.id");
    return query.getResultList();
}

From source file:com.excilys.ebi.sample.jpa.query.benchmark.repository.impl.NamedQueryRepository.java

@Override
@SuppressWarnings("unchecked")
public List<Song> getSongsBySameArtistOrderBySongTitle(Integer songId) {

    Query query = em.createNamedQuery("getSongsBySameArtist");
    query.setParameter(1, songId);//from   ww w. ja  v a 2  s.c  o m

    return query.getResultList();
}

From source file:cz.fi.muni.pa036.airticketbooking.dao.impl.FlightTicketDaoImpl.java

@Override
public List<FlightTicket> getAll() {
    Query q = em.createQuery("FROM FlightTicket");
    List<FlightTicket> objectTemp = q.getResultList();

    return Collections.unmodifiableList(objectTemp);
}

From source file:org.syncope.core.persistence.dao.impl.LoggerDAOImpl.java

@Override
public List<SyncopeLogger> findAll() {
    Query query = entityManager.createQuery("SELECT e FROM " + SyncopeLogger.class.getSimpleName() + " e");
    return query.getResultList();
}

From source file:org.syncope.core.persistence.dao.impl.AttrDAOImpl.java

@Override
public <T extends AbstractAttr> List<T> findAll(final Class<T> reference) {
    Query query = entityManager.createQuery("SELECT e FROM " + reference.getSimpleName() + " e");
    return query.getResultList();
}

From source file:org.syncope.core.persistence.dao.impl.EntitlementDAOImpl.java

@Override
public List<Entitlement> findAll() {
    Query query = entityManager.createQuery("SELECT e FROM Entitlement e");

    return query.getResultList();
}

From source file:org.syncope.core.persistence.dao.impl.NotificationDAOImpl.java

@Override
public List<Notification> findAll() {
    Query query = entityManager.createQuery("SELECT e " + "FROM " + Notification.class.getSimpleName() + " e");
    return query.getResultList();
}

From source file:uk.ac.ebi.intact.editor.services.admin.HqlQueryService.java

@Transactional(value = "jamiTransactionManager", readOnly = true, propagation = Propagation.REQUIRED)
public <T> List<T[]> runNativeQuery(int maxResults, String sqlQuery) {
    maxResults = Math.min(maxResults, MAX_RESULTS);

    EntityManager em = getIntactDao().getEntityManager();
    Query query = em.createNativeQuery(sqlQuery);
    query.setMaxResults(maxResults);/*from   w  w w  .j ava  2  s  . com*/

    return query.getResultList();
}

From source file:DAO.FichiersDAOImpl.java

@Transactional(readOnly = true)
@Override/*from   w w  w . j  a  v a  2  s  .  c  o m*/
public List<FichiersEntity> findAll() {
    Query q = em.createQuery("SELECT f FROM FichiersEntity f");
    return q.getResultList();
}

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

public List<VideoAmount> findAll() {
    Query query = em.createNativeQuery(queryString);
    List<Object[]> resultList = query.getResultList();
    return mapObject(resultList);
}