hello good people.I'm still learning what hibernate can do and this time i'm trying something that seems not to be working. i have 2 tables users and contacts.as you can guess contacts hold the relationship by have user_id as foreign key. here are snippet of the 2 mapping files. this first is from users.hbm.xml
<set name="contactsdetails">
<key column="userId"/>
<one-to-many class="Domain.Contacts"/>
</set>
and this one is from contacts.hbm.xml
<many-to-one class="Domain.Users" name="userId"/>
while every thing is working i mean at configuration,mapping file side and inserting into users table from UsersDAO, i'll like to insert into users and contacts at the same. Meaning i create my users object and assigning values to various properties, create one or array of contacts and assinging various properties to it to and finally add it to the contactdetails set property of users before i save the users objects.when i tried this i realised that it's kinda weird because the contact userId property is of the type users so i'll add user to contacts or each contacts object and then add the same contacts object to the contactsdetails property of users before i persist users objects.i'm sure i'm missing something and i'm having nullpointerexcpetion when i tried.Can you please show me how to do it? thanks for reading