// Path: app/src/main/java/de/codecentric/dao/NewsDao.java
// public interface NewsDao {
// 
//     List<News> getAllNews();
// 
//     void saveNews(News n);
// }
// 
// Path: app/src/main/java/de/codecentric/domain/News.java
// @Entity(name = "news")
// @NamedQueries({ @NamedQuery(name = "findAllNews", query = "from news")})
// public class News {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     private long id;
// 
//     @Column(length = 2048)
//     private String text;
// 
//     public News() {
//         // JPA default constructor
//     }
// 
//     public String getText() {
//         return text;
//     }
// 
//     public void setText(String text) {
//         this.text = text;
//     }
// }


import de.codecentric.dao.NewsDao;
import de.codecentric.domain.News;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;
package de.codecentric.dao.impl;



@Repository("newsDao")
@Transactional
public class JpaNewsDao implements NewsDao {

    @PersistenceContext
    private EntityManager em;

    public JpaNewsDao() {
        // default constructor
    }

    // Test constructor
    public JpaNewsDao(EntityManager em) {
        this.em = em;
    }

// Path: app/src/main/java/de/codecentric/dao/NewsDao.java
// public interface NewsDao {
// 
//     List<News> getAllNews();
// 
//     void saveNews(News n);
// }
// 
// Path: app/src/main/java/de/codecentric/domain/News.java
// @Entity(name = "news")
// @NamedQueries({ @NamedQuery(name = "findAllNews", query = "from news")})
// public class News {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     private long id;
// 
//     @Column(length = 2048)
//     private String text;
// 
//     public News() {
//         // JPA default constructor
//     }
// 
//     public String getText() {
//         return text;
//     }
// 
//     public void setText(String text) {
//         this.text = text;
//     }
// }


// Path: app/src/main/java/de/codecentric/dao/impl/JpaNewsDao.java
import de.codecentric.dao.NewsDao;
import de.codecentric.domain.News;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;

package de.codecentric.dao.impl;



@Repository("newsDao")
@Transactional
public class JpaNewsDao implements NewsDao {

    @PersistenceContext
    private EntityManager em;

    public JpaNewsDao() {
        // default constructor
    }

    // Test constructor
    public JpaNewsDao(EntityManager em) {
        this.em = em;
    }

    @Override public List<News> getAllNews() {