File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Optimum Hibernate Mapping for a Tree Model Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Optimum Hibernate Mapping for a Tree Model" Watch "Optimum Hibernate Mapping for a Tree Model" New topic
Author

Optimum Hibernate Mapping for a Tree Model

vijayender madura
Greenhorn

Joined: Jun 18, 2009
Posts: 13
Hi,
I'm new to Hibernate and i want to know which is the optimum technique(in terms of performance) to retrieve data in a tree model.
To illustrate:-

Product Table:
|productId| productName| Description| parentproductId|

I need to map this table to a product Class as follows:-



My Product table has loads of columns in addition to description and loads and loads of records too! What would be an optimum Hibernate mapping technique to retrieve the entire tree.

Note: There will be only one root product whose parentProductId would be null in the table.

Any help will be appreciated. Thanks.

'Scientia est Potentia'
 
jQuery in Action, 2nd edition
 
subject: Optimum Hibernate Mapping for a Tree Model
 
Similar Threads
Hibernate: one-to-one Different Composite Keys
Aggregate function (sum) of a @CollectionOfElements property
hibernate: retrieving only part of child collection
need to transfer productID from url to action class in struts 2
Hibernate - Annotations - many to many association