Hibernate Annotation (Pyramid Structure - same table)

Posted by fatnjazzy on Stack Overflow See other posts from Stack Overflow or by fatnjazzy
Published on 2011-01-17T07:39:28Z Indexed on 2011/01/17 7:53 UTC
Read the original article Hit count: 200

Filed under:
|
|

Hi,
I have a person table that contains the following fields:

id, name, parent_id.

the parent_id is actually a FK for column id. the data should look like this (Like a pyramid):

"id"   "name"                  "parent_id"

"1"    "I am the Top Father"   "1"
"2"    "My Father Is 1"        "1"
"3"    "My Father Is 2"        "2"
"4"    "My Father Is 2"        "2"

How is my bean suppose to look like?

Thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate