Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
HI All,
I have searched the forum but wasn't able to find close to my
requirements. I am a newbie to hibernate would greatly appreciate
if any inputs on how can i go about solving this issue
I have composite key based table to retrieve more like a tree
structure based entries
Code:
--------------------
|CategoryMaster |
|-------------------
| categoryId(PK)
| catName
| cateDesc
--------------------
--------------------
| Subcategory |
--------------------
| subcatId(PK)
| categoryId(FK)
| subcatName
| subcatDesc
--------------------
--------------------
| CategryDetails |
--------------------
|catdetailId(PK)
|categoryId(FK)
|subcatId(FK)
|catDetailName
|catDetailDesc
-------------------
basically wanted insert values based on foreign key constraints
e.g categoryDetails can contain values only for the available categoryId
and subcatId available on parent tables
Also retrieve details by giving categoryId and subcategoryId
I would greatly appreciate if someone could give me some pointers/examples/tutorials
whether i should use composite key mappings or parent child relations
to achieve the above functionality.
PS:- All PK e.g categoryId, subcatId, catdetailId is generated by sequence
iam using hibernate version 3.1 and MySql 5
Thanks a lot