Hibernate load in Text fields
<pre><code>private void display() {
   Session session = NewHibernateUtil.getSessionFactory().openSession();
    session.beginTransaction();
    OrderEntry oe = (OrderEntry) session.load(OrderEntry.class, new Integer(2) );
    firstname_tf.setText(oe.getFirstname());
}
</code></pre>

<p>Hello,
I would like to retrieve Objects from my database in a GUI. I use session.load, but I'm not sure how to transfer data to the GUI. I tried firstname_tf.setText(oe.getFirstname()); but nothing happens. Can please sombody help me. Please excuse my bad english.</p>

<p>public static void main(String args[]) {</p>

<pre><code>    /* Create and display the form */
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new UpdateUI().setVisible(true);
        }
    });
}


public class OrderEntry  implements java.io.Serializable {

     private Integer orderid;
     private String reference;
     private String type;
     private String cause;
     private String firstname;
     private String lastname;
     private String profession;
     private Set investigationMaterials = new HashSet(0);

    public OrderEntry() {
    }

    public OrderEntry(String reference, String type, String cause, String firstname, String lastname, String profession, Set investigationMaterials) {
       this.reference = reference;
       this.type = type;
       this.cause = cause;
       this.firstname = firstname;
       this.lastname = lastname;
       this.profession = profession;
       this.investigationMaterials = investigationMaterials;
    }

    public Integer getOrderid() {
        return this.orderid;
    }

    public void setOrderid(Integer orderid) {
        this.orderid = orderid;
    }
    public String getReference() {
        return this.reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }
    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }
    public String getCause() {
        return this.cause;
    }

    public void setCause(String cause) {
        this.cause = cause;
    }
    public String getFirstname() {
        return this.firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }
    public String getLastname() {
        return this.lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }
    public String getProfession() {
        return this.profession;
    }

    public void setProfession(String profession) {
        this.profession = profession;
    }
    public Set getInvestigationMaterials() {
        return this.investigationMaterials;
    }

    public void setInvestigationMaterials(Set investigationMaterials) {
        this.investigationMaterials = investigationMaterials;
    }
}
</code></pre>

<p>Mapping File</p>

<pre><code>&lt;hibernate-mapping&gt;
    &lt;class name="forensikmysql.entity.OrderEntry" table="order_entry" catalog="forensik_db" optimistic-lock="version"&gt;
        &lt;id name="orderid" type="java.lang.Integer"&gt;
            &lt;column name="orderid" /&gt;
            &lt;generator class="identity" /&gt;
        &lt;/id&gt;
        &lt;property name="reference" type="string"&gt;
            &lt;column name="reference" length="20" /&gt;
        &lt;/property&gt;
        &lt;property name="type" type="string"&gt;
            &lt;column name="type" length="50" /&gt;
        &lt;/property&gt;
        &lt;property name="cause" type="string"&gt;
            &lt;column name="cause" length="50" /&gt;
        &lt;/property&gt;
        &lt;property name="firstname" type="string"&gt;
            &lt;column name="firstname" length="50" /&gt;
        &lt;/property&gt;
        &lt;property name="lastname" type="string"&gt;
            &lt;column name="lastname" length="50" /&gt;
        &lt;/property&gt;
        &lt;property name="profession" type="string"&gt;
            &lt;column name="profession" length="50" /&gt;
        &lt;/property&gt;
        &lt;set name="investigationMaterials" table="investigation_material" inverse="true" lazy="true" fetch="select"&gt;
            &lt;key&gt;
                &lt;column name="orderid" /&gt;
            &lt;/key&gt;
            &lt;one-to-many class="forensikmysql.entity.InvestigationMaterial" /&gt;
        &lt;/set&gt;
    &lt;/class&gt;
&lt;/hibernate-mapping&gt;
</code></pre>

<p>Maybe somebody can show me a way to display data in a GUI using tables and textfields.</p>