Hi,
Is there anyway to make Hibernate map a lookup tables values to a variable in another tables class?
To outline the problem, I am working on a school project. In the database for this project I have a Vehicle table. One column of this table is an integer, the Type of the vehicle. In a separate lookup table, I have matched each integer value to a vehicle description. (i.e. 0 -> Car, 1 -> Truck, 3 -> SUV, 4 -> Motorcycle, etc).
It would be really nice to be able to call a method in the POJO for the Vehicle table that would give me the description of the vehicle. However I'm new to Hibernate and can't figure out how to tie a non-primary key in the VehicleType table to its foreign key in the Vehicle table.
Any suggestions would be reallllyyy appreciated.
Thanks,
Adam
|