Hibernate version:
3.0
I am pretty new to Hibernate and thought I had a lot of my way figured around, but I haven't tried to do anything like this before, so I'm asking for help.
Here's my problem. First of all this is legacy data, so I have no control over the data. I have one table with some data in it that I want to get (no problem doing that in Hibernate). One of the columns (lets call it number), sort of maps to another table with another piece of data I need.
For simplicity's sake, I'll put some sample data:
Code:
TABLE_ONE
NUMBER OTHER_DATA ANOTHER_DATA
------ ---------- ------------
010010 something 123 lois ln
02483 else 342 main st
064939 another 298 that way
TABLE_TWO
NO DATA_I_NEED
--- -----------
010 something here
02 another thing
064 something else
How it maps: substr(NUMBER, 1, length(NUMBER)-3) = NO
The piece of data I need associated with TABLE_ONE (in the object TableOne) is DATA_I_NEED. NUMBER is also the primary key of TABLE_ONE (which I need as is in my TableOne object as well).
Anyways, I keep looking at all the mapping file information and I don't seem to get how to do this.
Thanks in advance for any help!
Susan[/code]