Home » RADICORE development » Transaction Patterns » Tree structure
Re: Tree structure [message #4707 is a reply to message #4697] |
Fri, 24 April 2015 04:07 |
AJM
Messages: 2367 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
You have to adjust the first query to only select those entries at the top of the tree (ie: with tree_level=1). You are controlling the queries which the code issues, so it is up to you to get those queries right.
For your information I have successfully implemented tree views in my enterprise application using tables which do not include column names such as TREE_TYPE, TREE_LEVEL or TREE_NODE, and which have compound primary keys, so I know that it is definitely possible to do so. My most recent usage was to display a Bill of Materials (BOM) in my PRODUCT database which uses a single table which contains the product hierarchy, as shown below:
CREATE TABLE `product_component` (
`product_id_snr` VARCHAR(40) NOT NULL,
`product_id_jnr` VARCHAR(40) NOT NULL',
`seq_no` SMALLINT(5) UNSIGNED NOT NULL,
`revision_id_snr` VARCHAR(16) NULL DEFAULT NULL,
`revision_id_jnr` VARCHAR(16) NULL DEFAULT NULL,
`quantity` DECIMAL(15,6) UNSIGNED NOT NULL DEFAULT '1.000000',
`start_date` DATE NOT NULL DEFAULT '2000-01-01',
`end_date` DATE NULL DEFAULT '9999-12-31',
PRIMARY KEY (`product_id_snr`, `product_id_jnr`, `seq_no`)
);
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
Tree structure
|
|
|
Re: Tree structure
By: AJM on Sun, 06 July 2014 04:40
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Thu, 12 February 2015 04:34
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Fri, 13 February 2015 05:10
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Sat, 28 February 2015 06:20
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Sun, 01 March 2015 04:23
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Fri, 24 April 2015 04:07
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Tue, 05 May 2015 04:30
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Tue, 02 June 2015 05:12
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Tue, 02 June 2015 13:05
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Mon, 11 January 2021 13:50
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Wed, 13 January 2021 05:25
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Thu, 14 January 2021 05:09
|
|
|
Re: Tree structure
|
|
|
Re: Tree structure
By: AJM on Sat, 16 January 2021 05:06
|
|
|
Re: Tree structure
|
Goto Forum:
Current Time: Mon Nov 18 09:03:48 EST 2024
Total time taken to generate the page: 0.01333 seconds
|