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.dhenton9000.birt.jpa.service.impl.security.UsersServiceImpl.java

@Override
public List<Applications> findAuthorizedApplications(Integer id) {

    String qString = "select applications " + " from Users users " + " join users.groupsSet groups "
            + " join groups.applicationsSet applications " + " where users.userid = :id ";

    Query q = this.entityManager.createQuery(qString);
    q.setParameter("id", id);
    return q.getResultList();
}

From source file:com.dhenton9000.birt.jpa.service.impl.security.UsersServiceImpl.java

@Override
public List<Groups> findGroupsForUser(Integer id) {

    String qString = "select groups " + " from Users users " + " join users.groupsSet groups "
            + " where users.userid = :id ";

    Query q = this.entityManager.createQuery(qString);
    q.setParameter("id", id);
    return q.getResultList();
}

From source file:com.lscc.entity.test.integration.TripDiaryCreationIntegrationTest.java

@SuppressWarnings("unchecked")
private List<TripDiary> diariesCalled(String diaryName) {
    Query q = em.createQuery("Select td from TripDiary td where td.name = 'Test'");
    return q.getResultList();
}

From source file:gumga.framework.application.GumgaCrudAndQueryNotOnlyTypedRepositoryImpl.java

@Override
public List getResultList(String hql, Map<String, Object> param) {
    javax.persistence.Query query = entityManager.createQuery(hql);
    addParam(query, param);/*from www.  j  a  v a2s .co m*/
    return query.getResultList();
}

From source file:jv.jpatpl.service.PersonService.java

@SuppressWarnings("unchecked")
public List<Person> find(String name) {
    Query query = this.entityManager.createNamedQuery("Person.find");
    query.setParameter("name", "%" + name + "%");
    return query.getResultList();
}

From source file:myjpa.guest.model.Guests.java

public List<Guest> findAll(int start, int size) {

    Query query = getJpqlQuery();
    query.setFirstResult(start);/*  w  ww  .  j a  v a2 s.c  o  m*/
    query.setMaxResults(size);

    return query.getResultList();
}

From source file:org.jrecruiter.dao.jpa.IndustryDaoJpa.java

@SuppressWarnings("unchecked")
public List<Industry> getAllIndustriesOrdered() {

    final List<Industry> industries;

    final Query query = entityManager.createQuery("select ind from Industry ind " + "order by name ASC");

    industries = query.getResultList();

    return industries;
}

From source file:be.fedict.trust.service.dao.bean.AuditDAOBean.java

@SuppressWarnings("unchecked")
public List<AuditEntity> listAudits() {
    Query query = this.entityManager.createNamedQuery(AuditEntity.QUERY_LIST_ALL);
    return (List<AuditEntity>) query.getResultList();
}

From source file:com.tapas.evidence.repository.data.ReadOnlyRepositoryImpl.java

@Override
@SuppressWarnings("unchecked")
public List<T> findAll() {
    if (log.isTraceEnabled()) {
        log.trace("Reading all entities");
    }//from   w  w  w  .  ja  v  a  2 s. c o  m
    final Query query = this.entityManager.createQuery("from " + this.entityClass.getName());
    return query.getResultList();
}

From source file:com.telefonica.euro_iaas.commons.properties.impl.PropertiesDAOJPAImpl.java

/**
 * {@inheritDoc}/* ww w  .j av a 2 s .co  m*/
 */
public List<String> findNamespaces() {
    Query query = entityManager.createQuery(FIND_NAMESPACES);
    return query.getResultList();
}