Self « Table « JPA Q&A





1. Tree (self referencing table) with JPA    forum.hibernate.org

Hi I would like to create a mapping, that creates a tree of elements. sql: Code: create table menu( id INT unsigned AUTO_INCREMENT not null PRIMARY KEY, name varchar(20) not null, parent INT unsigned, position INT unsigned, content TEXT, ...

2. self-referencing table    forum.hibernate.org

Thanks Jens, Ive got a query in HQL now that is close to correct. This returns x number of objects which each have 0 to n children in their set. What I would like the query to do is go through the children and do the join for their children recursively (untill it reaches a row that has no children). The ...

3. many-to-many usage and self-referenced table    forum.hibernate.org

Hi, I'm newbie in hibernate, so excuse me if the questions are too trivial. 1) i have got many-to-many association between entities Book and Keyword. I don't know how to write a query to find books containing any keyword. I know that i can use a collection of keywords from a Book entity, but I down know, how to use it ...

4. How to create self referential many to many table? (MySpace)    forum.hibernate.org

Hello, I have a use case where I need to implement something like myspace, and indeed all of the social networking sites, is the ability to connect to friends or colleagues and have them listed on your page. This is can be done through 2 tables, by self-referential many-to-many relationship, user Friends -------- --------- ID AccountId ScnName friendId firstName LastName ... ...

5. Self-referencing does not respect TABLE?    forum.hibernate.org

Newbie Joined: Thu Jul 10, 2008 7:12 am Posts: 1 Hello to all. I have a problem with the following construct, when there is a self-reference in the PROGRAMMER table. The test case that I run throws an exception, that shows that the program tries to find the MANAGER_ID column in the wrong table (EMPLOYEE) . As you can see, I ...