Hibernate version: 3.2.7
MySQL version: 5.1.45
Hello,
I am developing a system that's going to have few hundred thousand or even million records in it.
This system should be able to make reports that contain information from hundreds or more records but I only need one or two columns from handful of tables.
Problem is that reading this information Hibernate loads tons of unnecessary information and it isn't very fast.
Here is small part of the tables in DB:
Code:
Order
|__Orderline
|__Delivery
|__Item
| |__Conditions
| |__Classifications
|__Address
|__Coordinates
Now for example from Order I need id and issueDate, from Orderline description and from Delivery min(latestDelivery). I don't need anything from the other tables (but they are eagerly loaded anyway).
Can I use views in Hibernate to gather data for the report or is there anyway else to solve this problem? And How is this done if possible?
I read somewhere that I can make classes that only use part of the table fields, is this true? As meaning that Hibernate creates a table Order(id, confirmed, orderlines, note, issudate, project_id, account_id) and then there is another class that uses part of the fields Order_view(id, orderlines, issuedate).
Mikko