All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.evasion.plugin.common.dao.AccountDAOImpl Maven / Gradle / Ivy

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.evasion.plugin.common.dao;

import com.evasion.dao.api.AbstractJPAGenericDAO;
import com.evasion.plugin.common.entity.Account;
import javax.persistence.NoResultException;
import javax.persistence.NonUniqueResultException;
import javax.persistence.Query;

/**
 *
 * @author sebastien
 */
public class AccountDAOImpl extends AbstractJPAGenericDAO {

    public Account findAccountByUsername(String username) {
        try {
            Query query = getEntityManager().createNamedQuery(Account.QUERY_ACCOUNT_BY_USERNAME);
            query.setParameter(1, username);
            return (Account) query.getSingleResult();
        } catch (NoResultException e) {
            return null;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy