Hello all,
first off, I am new to Hibernate and very unexperienced, this question might be really simple to answer or even in the documentation, if so, please point me there, as I tried searching it and didn't find something adequate. (Maybe I searched for the wrong terms?)
I have the following problem:I have a Database which was constructed with ORM in mind, so table mappings have been no problem.
Now however, I want to fetch results of a query and put those results into a List of POJO's (variables are the columns) which have no need to be persistent.
I had the idea to use a view and map that onto an Object, but I'm using MySQL and the performance with views is just way too bad.
Another thing is, those POJO's would be very similar in a lot of columns, is there any possibility to 'pack' entries together?
I'll give you an example of what I mean:
Quote:
if i have a table job-offering(JobOffID, Company, ..),
a table Job(JobID, jobofferingID(references JobOffID), actid(FK from activity table), ..)
a table activity(ActID, name, ..)
I want to join those tables on the appropriate values with a query selecting a subset of all columns and then have the result given back to me as a list of POJOs with those variables.
If someone could give me a hint how to do that, I'd be thankful.
An additional question (but of lesser importance):A lot of my results will only differ in the activity.name column (i.e. a painter will have activities 'paint' and 'mix colours')
Is there any convenient way to get those results into 1 POJO with the activity.name entries added to a list in that pojo?
If my question isn't clear enough please ask, I'll try to make it as clear as possible then.
Thanks.