-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Beginner trying to map to a lookup table...
PostPosted: Sat May 07, 2005 5:49 pm 
Newbie

Joined: Sat May 07, 2005 5:43 pm
Posts: 1
Location: Rochester, NY
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


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 07, 2005 6:35 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
it is simple many-to-one in hibernate

regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.