This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Object Relational Mapping and the fly likes [Hibernate] How to model/map lookup tables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "[Hibernate] How to model/map lookup tables" Watch "[Hibernate] How to model/map lookup tables" New topic
Author

[Hibernate] How to model/map lookup tables

Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4456
    
    6

I've found precious little out there about how to model and map lookup tables in Hibernate (see http://raibledesigns.com/page/rd?anchor=dynamic_queries_with_hibernate).

Simple examples:

Address
-------
stateCode (FK)


State (lookup for StateNames)
-----
stateCode (PK)
stateName

----
Another:


LineItem
---------
itemCode (FK)


Item
----
itemCode (PK)
itemDesc


Any and all tips appreciated. TIA!


Junilu - [How to Ask Questions] [How to Answer Questions]
 
Don't get me started about those stupid light bulbs.
 
subject: [Hibernate] How to model/map lookup tables