Received: from localhost (pluto.hub.org [200.46.204.4]) by postgresql.org (Postfix) with ESMTP id 9AE839FA2E9 for ; Fri, 3 Nov 2006 13:23:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.4]) (amavisd-new, port 10024) with ESMTP id 94348-03 for ; Fri, 3 Nov 2006 13:23:19 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from aa014msg.fastweb.it (aa014msg.fastweb.it [213.140.2.81]) by postgresql.org (Postfix) with ESMTP id 628FD9F9F0E for ; Fri, 3 Nov 2006 13:23:19 -0400 (AST) Received: from ms007msg.fastweb.it (10.31.40.140) by aa014msg.fastweb.it (7.3.105.6) id 453F558A0045B574 for pgsql-jdbc@postgresql.org; Fri, 3 Nov 2006 18:23:18 +0100 Received: from [192.168.1.201] (85.18.239.131) by ms007msg.fastweb.it (7.2.070) id 443CBBF0056064E9 for pgsql-jdbc@postgresql.org; Fri, 3 Nov 2006 18:19:04 +0100 From: Luca Ferrari To: pgsql-jdbc@postgresql.org Subject: jtree and sql queries Date: Fri, 3 Nov 2006 18:19:04 +0100 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200611031819.04728.fluca1978@infinito.it> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/22 X-Sequence-Number: 16064 Hi all, I'm just wondering if someone has already bound a JTree to a set of sql queries. I explain it better: I've got a person table, a skill table and a role table. Each person can play one or more role, and can have one or more skill. I'd like to show to the user the result of the query as a tree: person +- roles +- role1 +- role2 +skills +- skill1 +- skill2 .... As you can imagine, the difficult is to bind each node tree to its table and to a specific query. For now I've bound each node to its table and its key value (with bound I mean that from the node I can know which table and key I must use to find the row in the database), but my difficult now is to refresh the tree each time the user makes a changes to the database. Unlike the use of simple tables, building the tree is more complex, because more queries must be performed, so I was wondering if someone out there has already something similar and can suggest me. Thanks, Luca