Code Affiche

 //packages a importrer si necessaire

  //import javax.ejb.Remote;
  //import javax.ejb.Remove;
  //import javax.ejb.Stateful;
  //import javax.persistence.EntityManager;
  //import javax.persistence.PersistenceContext;
  //import javax.persistence.NamedQuery;


  public String Affich()
   {


   	String s="";
   	java.util.List <Document>  list=null;
   	try{
   	 list=manager.createQuery("SELECT OBJECT(doc) FROM Document doc").getResultList();
   	   }catch (Exception e){System.out.println("erreur2 :: "+e.toString());}
   	for (int i=0;i<list.size();i++)
   	{
   		try{
   		Document document=(Document) list.get(i);
   		s+=("Nom :: "+document.getName()+"\n");
   		s+=("Contenu :: "+document.getContent()+"\n");
   	   		}catch (Exception e){System.out.println("erreur3 :: "+e.toString());}
   	}

   	return s;
   }