DISCLAIMER: A long post, but I hope to show everyone that I have tried to figure it out on my own. Any assistance would be much appreciated!! Hibernate 3.2.CR2
MySQL 5.0 / InnoDB
A RescueCenter contains 1 Vet and 0...* Pet objects. A Pet contains 1 PetData. Both PetData.size and Vet.age are of type Integer so that null values are stored when empty. For the front-end, I have an HTML page using
JSF to populate and search the DB.
I understand the basic select, insert, update, and delete SQL commands. I'm shaky when it comes to the different JOINs. I could really use some help with the proper syntax for querying with hibernate.
(1) PROPER ID ASSIGNMENT: When saving a rescue center, I don't want to insert duplicate vet and pet_data. To ensure this, should I check for a row with identical data in those rows.. if one is found, set that object to the pet/rescue center. For example:
After checking (and replacing) all the vet/pet_data dupes, I then save the rescue center [ session.save / .saveOrUpdate( rescueCenter ) ]. Is this the best (or only) way to handle this situation?
[ June 20, 2006: Message edited by: Ed Degeyter ]
[ June 20, 2006: Message edited by: Ed Degeyter ]