Hibernate version:2.1.6
I am have a tough time trying to figure out when to use joined-subclass, component, many-to-one, etc.
I have a table that is called issues. In a form I have several drop down boxes with choices for things like PC Model (Gateway, Dell, etc) Monitor Model (VX770, EV700, etc), Operating System, etc, etc. All these are retrieved from respective tables in my database and all these tables basically have 2 fields (id and Model) respectivly. My issue table will just hold the id of these other tables as foreign keys.
My question is what should I use to map these so that when I write an issue to the database, the id is put in the issue table, but when I retrieve these values for display, I have the actual text (model field) of that id that was stored?
I looked into using a Set or Map or List but those hold collections and these are single static items per issue. A one-to-one mapping really. So should I create POJO's for each of these tables with the 2 properties? That seems like overkill for what I want to do unless that is the only way? I have been reading HIA and I understand how to use all of the different mapping types, but figuring out when is what is getting me.
Thanks for any help
_________________ Gregg Bolinger
Javaranch Sheriff
Weblog
|