Hi -
I currently have two objects: User and Item. A one-to-many relationship exists between User and Item; and furthermore, a User has a default item. So, User has a foreign key to Item (for the default item) and each Item has a foreign key to the User.
Now, I have a problem with inserting this data into the database - I am currently using seqhilo for ID generation. The problem is arising because I can't insert User first because it needs the Item ID, and vice versa.
I don't want to first insert each User and each Item, then associate the two, and then update the User and Item because that is clearly inefficient. How can I resolve this...?
|