Example usage for javax.persistence TypedQuery toString

List of usage examples for javax.persistence TypedQuery toString

Introduction

In this page you can find the example usage for javax.persistence TypedQuery toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.jasig.portlet.notice.service.jpa.JpaNotificationDao.java

@Override
@Transactional(readOnly = true)//w w w . j  a v  a2 s.c  o m
public Set<JpaEntry> getEntriesByRecipient(String username) {
    Validate.notEmpty(username, "Argument 'username' cannot be empty");

    final String jpql = "SELECT DISTINCT v.entry FROM JpaEvent v " + "WHERE v.username = :username";
    TypedQuery<JpaEntry> query = entityManager.createQuery(jpql, JpaEntry.class);

    log.debug("Query getEntriesByRecipient={}", query.toString());

    query.setParameter("username", username);
    List<JpaEntry> rslt = query.getResultList();
    return new HashSet<JpaEntry>(rslt);
}