Package test

Examples of test.NewsBean


  @SuppressWarnings("unchecked")
  public static List<NewsBean> creareListaNews(){
   
    List<News> n=new ArrayList<News>();
    List<NewsBean> data=new ArrayList<NewsBean>();
    NewsBean c= new NewsBean();
    EntityManagerFactory emf = Persistence
        .createEntityManagerFactory("modul3L2");
    em = emf.createEntityManager();
     em.getTransaction().begin();
    Query query = em.createQuery("SELECT n FROM News n");
    n=query.getResultList();
    int i=0;
    for(News ind:n){
      c.setContinutNews(ind.getContinut());
      c.setContinutShortNews(ind.getContinut().substring(0, 121)+"...");
     
      data.add(c);
    }
    em.getTransaction().commit();
    return data;
View Full Code Here


  @SuppressWarnings("unchecked")
  public static List<NewsBean> creareListaNews() {

    List<News> n = new ArrayList<News>();
    List<NewsBean> data = new ArrayList<NewsBean>();
    NewsBean c = new NewsBean();
    EntityManagerFactory emf = Persistence
        .createEntityManagerFactory("modul3L2");
    em = emf.createEntityManager();
    em.getTransaction().begin();
    Query query = em.createQuery("SELECT n FROM News n");
    n = query.getResultList();
    int i = 0;
    for (News ind : n) {
      c.setContinutNews(ind.getContinut());
      c.setContinutShortNews(ind.getContinut().substring(0, 90) + "...");

      data.add(c);
    }
    em.getTransaction().commit();
    em.close();
View Full Code Here

    em = emf.createEntityManager();
    em.getTransaction().begin();
    Query query = em.createQuery("SELECT n FROM News n");
    n = query.getResultList();   
    for (News ind : n) {
      NewsBean c = new NewsBean();
      c.setSelected(false);
      c.setRemove(false);
      c.setStire(ind);     
      data.add(c);
    }
    em.getTransaction().commit();
    em.close();
    return data;
View Full Code Here

  @SuppressWarnings("unchecked")
  public static List<NewsBean> creareListaNews(){
   
    List<News> n=new ArrayList<News>();
    List<NewsBean> data=new ArrayList<NewsBean>();
    NewsBean c= new NewsBean();
    EntityManagerFactory emf = Persistence
        .createEntityManagerFactory("modul3L2");
    em = emf.createEntityManager();
     em.getTransaction().begin();
    Query query = em.createQuery("SELECT n FROM News n");
    n=query.getResultList();
    int i=0;
    for(News ind:n){
      c.setContinutNews(ind.getContinut());
      c.setContinutShortNews(ind.getContinut().substring(0, 121)+"...");
     
      data.add(c);
    }
    em.getTransaction().commit();
    em.close();
View Full Code Here

  @SuppressWarnings("unchecked")
  public static List<NewsBean> creareListaNews() {

    List<News> n = new ArrayList<News>();
    List<NewsBean> data = new ArrayList<NewsBean>();
    NewsBean c = new NewsBean();
    EntityManagerFactory emf = Persistence
        .createEntityManagerFactory("modul3L2");
    em = emf.createEntityManager();
    em.getTransaction().begin();
    Query query = em.createQuery("SELECT n FROM News n");
    n = query.getResultList();   
    for (News ind : n) {
      c.setContinutNews(ind.getContinut());
      c.setContinutShortNews(ind.getContinut().substring(0, 90) + "...");
      data.add(c);
    }
    em.getTransaction().commit();
    em.close();
    return data;
View Full Code Here

  @SuppressWarnings("unchecked")
  public static List<NewsBean> creareListaNews(){
   
    List<News> n=new ArrayList<News>();
    List<NewsBean> data=new ArrayList<NewsBean>();
    NewsBean c= new NewsBean();
    EntityManagerFactory emf = Persistence
        .createEntityManagerFactory("modul3L2");
    em = emf.createEntityManager();
     em.getTransaction().begin();
    Query query = em.createQuery("SELECT n FROM News n");
    n=query.getResultList();
    int i=0;
    for(News ind:n){
      c.setContinutNews(ind.getContinut());
      c.setContinutShortNews(ind.getContinut().substring(0, 121)+"...");
     
      data.add(c);
    }
    em.getTransaction().commit();
    return data;
View Full Code Here

    em = emf.createEntityManager();
    em.getTransaction().begin();
    Query query = em.createQuery("SELECT n FROM News n");
    n = query.getResultList();   
    for (News ind : n) {
      NewsBean c = new NewsBean();
      c.setSelected(false);
      c.setRemove(false);
      c.setStire(ind);     
      data.add(c);
    }
    em.getTransaction().commit();
    em.close();
    return data;
View Full Code Here

  @SuppressWarnings("unchecked")
  public static List<NewsBean> creareListaNews(){
   
    List<News> n=new ArrayList<News>();
    List<NewsBean> data=new ArrayList<NewsBean>();
    NewsBean c= new NewsBean();
    EntityManagerFactory emf = Persistence
        .createEntityManagerFactory("modul3L2");
    em = emf.createEntityManager();
     em.getTransaction().begin();
    Query query = em.createQuery("SELECT n FROM News n");
    n=query.getResultList();
    int i=0;
    for(News ind:n){
      c.setContinutNews(ind.getContinut());
      c.setContinutShortNews(ind.getContinut().substring(0, 121)+"...");
      c.setId(String.valueOf(i++));
      data.add(c);
    }
    return data;
   
  }
View Full Code Here

TOP

Related Classes of test.NewsBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.