This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
This can be achieved by <many-to-one> mapping. Just that the parentProduct is the Product object itself. so the mapping for the parentProduct would
look something like
<many-to-one name="parentProduct" class="Product" column="PARENT_PRODUCT_ID" cascade="save-update"/>
To get all the child products for a parent product, you can use criteria with restrictions, which would be something like
criteria.add(Restrictions.eq("parentProduct.productId", new Integer(1)));
Here we are getting all child products for the parent product with product Id =1