ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: building a hierarchy
Date Wed, 06 Apr 2005 16:22:09 GMT
There are some solutions. The upcoming jpetstore (now jgamestore) will
be using a technique for hierarchal data storeage and retrieval. It is
based on a good article
(http://www.sitepoint.com/article/hierarchical-data-database). I found
some of the functionality lacking so i expanded upon it. I would be
happy to pass you the jgamestore code we are using for this. Or you
can read the article and figure out your own version.


On Apr 6, 2005 10:16 AM, Steven Pannell <steven.pannell@zooplus.com> wrote:
> Hi,
> Does anyone know how I could (if possible) build a hierarchy of objects
> using a single SQL statement.  Is this possible?
> For example I have a SQL table of BOXES.  A BOX can contain other BOXES and
> so on, like:
> class BOX {
>         public void id();
>         public void parentBoxId();
>         public BOX getChild();
> }
> my sql would be something like:
> select * from boxes b1, boxes b2
> where b1.id = b2.parentBoxId;
> result is a big list of boxes but I want the parent / child hierarchy.
> anyway to do this?  know what I mean?
> thx.
> Steve.

View raw message