de.lava.marvin.whaosleaguepersistence.dao.impl.LinkDaoImpl.java Source code

Java tutorial

Introduction

Here is the source code for de.lava.marvin.whaosleaguepersistence.dao.impl.LinkDaoImpl.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package de.lava.marvin.whaosleaguepersistence.dao.impl;

import de.lava.marvin.whaosleaguebeans.Link;
import de.lava.marvin.whaosleaguepersistence.dao.LinkDao;
import java.util.List;
import javax.persistence.TypedQuery;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author mlava
 */
@Repository
@Transactional(propagation = Propagation.REQUIRED)
public class LinkDaoImpl extends BaseDaoImpl<Link> implements LinkDao {

    @Override
    public List<Link> getAllLinks() {
        TypedQuery<Link> query = entityManager.createNamedQuery("allLinks", Link.class);
        return query.getResultList();
    }

}