facebook

Tree structure map to table by hibernate

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #311533 Reply

    leung1_2000
    Member

    Hi all,

    I would like to implement a tree structure for different layers of categories
    E.g

    Trades -> electrical, plumbing, handyman…
    |
    |->parttime, fulltime, experienced, non-experienced

    public class Category {
    private ArrayList<Category> subs;
    private String description;

    public Category(){}

    public Category(String _desc)
    {
    description = _desc;
    }

    public void setList(Arraylist<Category> arylst)
    {
    ….
    }
    public Arraylist<Category> getList()
    {
    return subs;
    }
    }

    transaction = session.beginTransaction();
    session.save(categoryhead);
    transaction.commit();

    The data structure is a multilayer tree. How can this be implemented by hibernate?
    Thanks

Viewing 1 post (of 1 total)
Reply To: Tree structure map to table by hibernate

You must be logged in to post in the forum log in