2 Replies Latest reply on Jun 25, 2007 3:09 AM by alexrozario

    Retrieving data from database

    alexrozario

      Hi all,

      I have created an entity bean class as Stores.java and Stateless Session bean as SearchSession.java.

      And i am using Search.xhtml(facelet) file to retrieve data from table Stores in my local database.

      I am using Seam 1.2.1 GA version to configure them

      and i am using a query as
      List details =em.createQuery("select s from Stores s").getResultList(); in my Session bean.

      and i am using datatable in my .xhtml file to view the data.
      but it doesn't shows any result. my table has more than 5 records. whats wrong in my coding. how to overcome this..

      please help me..

      thanks in advance..

      i am waiting for your valueable help

        • 1. Re: Retrieving data from database
          waynebaylor

          did you insert the records into the table manually or did you use the EntityManager?

          i've noticed that when i insert records manually queries made with EntityManager don't see them for a while. Not sure yet why that is...

          if that's not your problem, then i would try the query as

          em.createQuery("from "+Stores.class.getName()).getResultList();



          • 2. Re: Retrieving data from database
            alexrozario

            fine. thank you for your response..

            but i found that the problem is not in retrieving the data but the problem is in viewing those data in my (jsf)facelet file.

            can you help me to view/show/display that data in my facelt

            thank you