-
May 22nd, 2006, 12:07 AM
#1
single Pojo and Multiple Tables
Hi,
<code>
public class Intermediary extends com.chakra.model.BaseObject implements java.io.Serializable {
// Fields
private Integer id;
private String companyName;
private Address address = new Address();
private WpContact wpContact = new WpContact();
all getters and setters
</code>
I have class WpContact corresponding to table wp_contact
public class WpContact extends com.chakra.model.BaseObject implements java.io.Serializable {
private Long contact id;
private String firstName;
private String lastName ; //required
private String email; required unique
all getters and setters
I have created Managers and ManagerImpl Dao and Hibernate Dao
But I dont know exactly how to create Intermediary.hbm.xml
so that it will save values of wpContact in wp_contact table
I have the form which displays thee fields from wp_contact intermediary.jsp
What things are to be done to ensure wp_contact details are also saved
My id and companyname is saved in wp_company.
also I have to insert into table wp_company_contact the values of
the newly generated company id ,contact id ( i have seen appfuse example but i am missing something)
only companyname and id gets inserted whille i lose wp_contact details
what should i do
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules