HIBERNATE- one-to-many mapping with different field names
George Tkebuchava
Greenhorn
Joined: Jul 23, 2007
Posts: 3
posted
0
I'm working with persistent XML data rather then POJOs and trying to figure out how to get one-to-many mapping working when field names are different, in Table_1 its PERSON_ID and in Table_2 it's PER_PERSON_ID. DB is Oracle 8i.
Yep, the error you get is what you should have gotten. The key tag iin your set needs to point to the column that is the FK in table_2 which is not PERSON_ID, so what is it? I'll let you figure that out. What is the foreign key column in Table_2, that is what goes into your column attribute of the key tag.
Mark
George Tkebuchava
Greenhorn
Joined: Jul 23, 2007
Posts: 3
posted
0
Thank you Mark, I tried using PER_PERSON_ID as a key value, however I still got �invalid column name� error. After your comment I checked the rest of the file and discovered that error was not related to PER_PERSON_ID. Thanks again, George
Originally posted by George Tkebuchava: Thank you Mark, I tried using PER_PERSON_ID as a key value, however I still got �invalid column name� error. After your comment I checked the rest of the file and discovered that error was not related to PER_PERSON_ID. Thanks again, George
Was it some other column that didn't exist in the table that you had a different attribute attempt to map to?
Mark
George Tkebuchava
Greenhorn
Joined: Jul 23, 2007
Posts: 3
posted
0
Yes, in sort I specified field that didn't exist and was giving me issues all along. In addition since I�m new to hibernate I made some false assumptions and it all added up. Thanks, George
subject: HIBERNATE- one-to-many mapping with different field names