I have two classes, Project and ProjectStep, with corresponding tables in a basic one record->one instance setup. For performance reasons (simplifying a bit here), the two are pulled into a view we'll call ProjectCurrentStep. What I want to do is create a mapping that will generate a Project and a ProjectStep for each row returned from this view. It seems like this should be a relatively common occurrence, but I'm having a difficult time finding info on the best way to go about doing this.
What I'm thinking so far is that I'll need an intermediate class, ProjectCurrentStep, which will have as attributes a Project and a ProjectStep instance. I believe I can do this by declaring the Project and ProjectStep attributes as components, but this would duplicate their hibernate mappings. Is there a way to import mappings?
The other option I'm considering is thinking of the ProjectCurrentStep class as a facade, delegating calls to its getters and setters to the contained Project and ProjectStep instances.
Thanx ahead for any help...
|