Howdy,
I'm using Hibernate 2.1.8, JDK 1.4.2 and Oracle9i.
I've been scouring the documentation, tutorials and hibernate action book and can't find a way to do the following. Any suggestions would be appreciated.
Let's say I have the following two persistant classes which I can map to the database. With the exception of the companyName field in User.
Class: Company
- id
- name
Class: User
- id
- name
- companyId
- companyName (not a column in the database, just a convenience method)
I want to populate the companyName when I retrieve a list of Users based on the companyId stored for that user. Can this be done and how? Or do I just create a one to one mapping? I was hoping to keep the number of objects retrieved low.
Thanks!
|