Forums Register Login

Cannot save relations

+Pie Number of slices to send: Send
I am working with JPA and Hibernate in MyEclipse 7.0. I generated the entities and DAOS and everything is working correctly in a struts application. Now I am running a test program to create children objects (Booking) related to a parent (Hotel). The source code is:

The code is creating the children but the foreign keys in the table remain null. I do not know what i am doing wrong.

Your help will be greatly appreciated,

Alejandro Barrero
+Pie Number of slices to send: Send
I found the answer. I have to set the hotel (parent) in the booking (child): b.setHotel(h);
Everybody's invited. Except this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 568 times.
Similar Threads
Serialization topic
com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException
<identifier> expected error
ArrayList
Compile time error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:48:31.