Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Hibernate DAO and adf table

700833May 13 2010 — edited May 14 2010
Hi,
I am trying to display data retreived via a hibernate DAO in an adf table. Here is my code.

Backing bean:
public class SectionBean {

    private Session sess = null;
       private List listo;

  }

    public void setList(List listi) {

        SessionFactory sessionFactory =
            new Configuration().configure().buildSessionFactory();
        sess = sessionFactory.openSession();
        listi = new ArrayList();
        listi =
                sess.createSQLQuery("SELECT * FROM subsection").addScalar("ID", Hibernate.LONG).addScalar("NAME",
                                                                                                          Hibernate.STRING).addScalar("DESCRIPTION",
                                                                                                                                      Hibernate.STRING).list();
        
        this.listo = list;
    }


    public List getList() {
        return listo;
    }


    public void endSession() {
        sess.close();
    }

}
AF table:
 <af:table summary="tbsm" var="ss"
                    value="#{backing_lb.listo}" rowBandingInterval="0" id="t1"
                    >
            <af:column rowHeader="true" sortable="false" headerText="Description" align="start"
                       id="c1">
              <af:outputText value="#{ss.DESCRIPTION}" id="ot4"/>
            </af:column>
            <af:column rowHeader="true" sortable="false" headerText="Name" align="start"
                       id="c2">
              <af:outputText value="#{ss.NAME}" id="ot5"/>
            </af:column>

          </af:table>
The DAO works fine by itself, it retrieves the data. but the table does not display the information.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2010
Added on May 13 2010
7 comments
1,189 views