Hibernate version: 2.1.8
Name and version of the database you are using: Oracle 9
Hi Hibernators,
I have a performance-tuning question. Let's say I have a DB table called "child" which has a foreign key field called "parent_id" (integer) which, for each record, holds the id of the related record from the "parent" table. I am using hibernate to manage these "Child" objects and I want to create a new Child object which would be related to a particular Parent object. I have the parent_id value which I got from a web page form, but I don't have the corresponding Parent object. Must I get this Parent object from the DB just so I can put it on the Child object and then save the Child object? After it is inserted I am not going to make further use of either object during the session.
I guess a more generic way to ask the question is... can I manually specify the value of a foreign key field which is represented in Java-land as an Object property, or should I just use plain old SQL to do the insert?
Thanks!
-Eric
|