Project

General

Profile

« Previous | Next » 

Revision a7c68045

Added by Andreas Müller about 15 years ago

TaxonomicTree implementation (persistence)

View differences:

cdmlib-persistence/src/test/resources/dbscripts/001_cdm.ddl
3748 3748
        referenceforparentchildrelation_id integer,
3749 3749
        synonymtobeused_id integer,
3750 3750
        taxon_id integer,
3751
        taxonomicview_id integer,
3751
        taxonomictree_id integer,
3752 3752
        primary key (id),
3753 3753
        unique (uuid)
3754 3754
    );
......
3768 3768
        referenceforparentchildrelation_id integer,
3769 3769
        synonymtobeused_id integer,
3770 3770
        taxon_id integer,
3771
        taxonomicview_id integer,
3771
        taxonomictree_id integer,
3772 3772
        primary key (id, REV)
3773 3773
    );
3774 3774

  
......
3869 3869
        primary key (REV, TaxonRelationship_id, markers_id)
3870 3870
    );
3871 3871

  
3872
    create table TaxonomicView (
3872
    create table TaxonomicTree (
3873 3873
        id integer not null,
3874 3874
        created timestamp,
3875 3875
        uuid varchar(36),
......
3890 3890
        unique (uuid)
3891 3891
    );
3892 3892

  
3893
    create table TaxonomicView_AUD (
3893
    create table TaxonomicTree_AUD (
3894 3894
        id integer not null,
3895 3895
        REV integer not null,
3896 3896
        revtype tinyint,
......
3912 3912
        primary key (id, REV)
3913 3913
    );
3914 3914

  
3915
    create table TaxonomicView_Annotation (
3916
        TaxonomicView_id integer not null,
3915
    create table TaxonomicTree_Annotation (
3916
        TaxonomicTree_id integer not null,
3917 3917
        annotations_id integer not null,
3918
        primary key (TaxonomicView_id, annotations_id),
3918
        primary key (TaxonomicTree_id, annotations_id),
3919 3919
        unique (annotations_id)
3920 3920
    );
3921 3921

  
3922
    create table TaxonomicView_Annotation_AUD (
3922
    create table TaxonomicTree_Annotation_AUD (
3923 3923
        REV integer not null,
3924
        TaxonomicView_id integer not null,
3924
        TaxonomicTree_id integer not null,
3925 3925
        annotations_id integer not null,
3926 3926
        revtype tinyint,
3927
        primary key (REV, TaxonomicView_id, annotations_id)
3927
        primary key (REV, TaxonomicTree_id, annotations_id)
3928 3928
    );
3929 3929

  
3930
    create table TaxonomicView_Credit (
3931
        TaxonomicView_id integer not null,
3930
    create table TaxonomicTree_Credit (
3931
        TaxonomicTree_id integer not null,
3932 3932
        credits_id integer not null,
3933 3933
        sortIndex integer not null,
3934
        primary key (TaxonomicView_id, sortIndex),
3934
        primary key (TaxonomicTree_id, sortIndex),
3935 3935
        unique (credits_id)
3936 3936
    );
3937 3937

  
3938
    create table TaxonomicView_Credit_AUD (
3938
    create table TaxonomicTree_Credit_AUD (
3939 3939
        REV integer not null,
3940
        TaxonomicView_id integer not null,
3940
        TaxonomicTree_id integer not null,
3941 3941
        credits_id integer not null,
3942 3942
        sortIndex integer not null,
3943 3943
        revtype tinyint,
3944
        primary key (REV, TaxonomicView_id, credits_id, sortIndex)
3944
        primary key (REV, TaxonomicTree_id, credits_id, sortIndex)
3945 3945
    );
3946 3946

  
3947
    create table TaxonomicView_Extension (
3948
        TaxonomicView_id integer not null,
3947
    create table TaxonomicTree_Extension (
3948
        TaxonomicTree_id integer not null,
3949 3949
        extensions_id integer not null,
3950
        primary key (TaxonomicView_id, extensions_id),
3950
        primary key (TaxonomicTree_id, extensions_id),
3951 3951
        unique (extensions_id)
3952 3952
    );
3953 3953

  
3954
    create table TaxonomicView_Extension_AUD (
3954
    create table TaxonomicTree_Extension_AUD (
3955 3955
        REV integer not null,
3956
        TaxonomicView_id integer not null,
3956
        TaxonomicTree_id integer not null,
3957 3957
        extensions_id integer not null,
3958 3958
        revtype tinyint,
3959
        primary key (REV, TaxonomicView_id, extensions_id)
3959
        primary key (REV, TaxonomicTree_id, extensions_id)
3960 3960
    );
3961 3961

  
3962
    create table TaxonomicView_Marker (
3963
        TaxonomicView_id integer not null,
3962
    create table TaxonomicTree_Marker (
3963
        TaxonomicTree_id integer not null,
3964 3964
        markers_id integer not null,
3965
        primary key (TaxonomicView_id, markers_id),
3965
        primary key (TaxonomicTree_id, markers_id),
3966 3966
        unique (markers_id)
3967 3967
    );
3968 3968

  
3969
    create table TaxonomicView_Marker_AUD (
3969
    create table TaxonomicTree_Marker_AUD (
3970 3970
        REV integer not null,
3971
        TaxonomicView_id integer not null,
3971
        TaxonomicTree_id integer not null,
3972 3972
        markers_id integer not null,
3973 3973
        revtype tinyint,
3974
        primary key (REV, TaxonomicView_id, markers_id)
3974
        primary key (REV, TaxonomicTree_id, markers_id)
3975 3975
    );
3976 3976

  
3977
    create table TaxonomicView_OriginalSource (
3978
        TaxonomicView_id integer not null,
3977
    create table TaxonomicTree_OriginalSource (
3978
        TaxonomicTree_id integer not null,
3979 3979
        sources_id integer not null,
3980
        primary key (TaxonomicView_id, sources_id),
3980
        primary key (TaxonomicTree_id, sources_id),
3981 3981
        unique (sources_id)
3982 3982
    );
3983 3983

  
3984
    create table TaxonomicView_OriginalSource_AUD (
3984
    create table TaxonomicTree_OriginalSource_AUD (
3985 3985
        REV integer not null,
3986
        TaxonomicView_id integer not null,
3986
        TaxonomicTree_id integer not null,
3987 3987
        sources_id integer not null,
3988 3988
        revtype tinyint,
3989
        primary key (REV, TaxonomicView_id, sources_id)
3989
        primary key (REV, TaxonomicTree_id, sources_id)
3990 3990
    );
3991 3991

  
3992
    create table TaxonomicView_Rights (
3993
        TaxonomicView_id integer not null,
3992
    create table TaxonomicTree_Rights (
3993
        TaxonomicTree_id integer not null,
3994 3994
        rights_id integer not null,
3995
        primary key (TaxonomicView_id, rights_id),
3995
        primary key (TaxonomicTree_id, rights_id),
3996 3996
        unique (rights_id)
3997 3997
    );
3998 3998

  
3999
    create table TaxonomicView_Rights_AUD (
3999
    create table TaxonomicTree_Rights_AUD (
4000 4000
        REV integer not null,
4001
        TaxonomicView_id integer not null,
4001
        TaxonomicTree_id integer not null,
4002 4002
        rights_id integer not null,
4003 4003
        revtype tinyint,
4004
        primary key (REV, TaxonomicView_id, rights_id)
4004
        primary key (REV, TaxonomicTree_id, rights_id)
4005 4005
    );
4006 4006

  
4007
    create table TaxonomicView_TaxonNode (
4008
        TaxonomicView_id integer not null,
4007
    create table TaxonomicTree_TaxonNode (
4008
        TaxonomicTree_id integer not null,
4009 4009
        rootnodes_id integer not null,
4010
        primary key (TaxonomicView_id, rootnodes_id),
4010
        primary key (TaxonomicTree_id, rootnodes_id),
4011 4011
        unique (rootnodes_id)
4012 4012
    );
4013 4013

  
4014
    create table TaxonomicView_TaxonNode_AUD (
4014
    create table TaxonomicTree_TaxonNode_AUD (
4015 4015
        REV integer not null,
4016
        TaxonomicView_id integer not null,
4016
        TaxonomicTree_id integer not null,
4017 4017
        rootnodes_id integer not null,
4018 4018
        revtype tinyint,
4019
        primary key (REV, TaxonomicView_id, rootnodes_id)
4019
        primary key (REV, TaxonomicTree_id, rootnodes_id)
4020 4020
    );
4021 4021

  
4022 4022
    create table TermVocabulary (
......
7411 7411

  
7412 7412
    alter table TaxonNode 
7413 7413
        add constraint FK924F5BCCD019B239 
7414
        foreign key (taxonomicview_id) 
7415
        references TaxonomicView;
7414
        foreign key (taxonomictree_id) 
7415
        references TaxonomicTree;
7416 7416

  
7417 7417
    alter table TaxonNode 
7418 7418
        add constraint FK924F5BCC215EDF26 
......
7529 7529
        foreign key (REV) 
7530 7530
        references AuditEvent;
7531 7531

  
7532
    alter table TaxonomicView 
7532
    alter table TaxonomicTree 
7533 7533
        add constraint FKE333A2E7765B124B 
7534 7534
        foreign key (reference_id) 
7535 7535
        references ReferenceBase;
7536 7536

  
7537
    alter table TaxonomicView 
7537
    alter table TaxonomicTree 
7538 7538
        add constraint FKE333A2E74FF2DB2C 
7539 7539
        foreign key (createdby_id) 
7540 7540
        references UserAccount;
7541 7541

  
7542
    alter table TaxonomicView 
7542
    alter table TaxonomicTree 
7543 7543
        add constraint FKE333A2E777E2F09E 
7544 7544
        foreign key (name_id) 
7545 7545
        references LanguageString;
7546 7546

  
7547
    alter table TaxonomicView 
7547
    alter table TaxonomicTree 
7548 7548
        add constraint FKE333A2E7BC5DA539 
7549 7549
        foreign key (updatedby_id) 
7550 7550
        references UserAccount;
7551 7551

  
7552
    alter table TaxonomicView_AUD 
7552
    alter table TaxonomicTree_AUD 
7553 7553
        add constraint FK976053834869AAE 
7554 7554
        foreign key (REV) 
7555 7555
        references AuditEvent;
7556 7556

  
7557
    alter table TaxonomicView_Annotation 
7557
    alter table TaxonomicTree_Annotation 
7558 7558
        add constraint FKE5DF73A7D019B239 
7559
        foreign key (TaxonomicView_id) 
7560
        references TaxonomicView;
7559
        foreign key (TaxonomicTree_id) 
7560
        references TaxonomicTree;
7561 7561

  
7562
    alter table TaxonomicView_Annotation 
7562
    alter table TaxonomicTree_Annotation 
7563 7563
        add constraint FKE5DF73A71E403E0B 
7564 7564
        foreign key (annotations_id) 
7565 7565
        references Annotation;
7566 7566

  
7567
    alter table TaxonomicView_Annotation_AUD 
7567
    alter table TaxonomicTree_Annotation_AUD 
7568 7568
        add constraint FK3C4B75F834869AAE 
7569 7569
        foreign key (REV) 
7570 7570
        references AuditEvent;
7571 7571

  
7572
    alter table TaxonomicView_Credit 
7572
    alter table TaxonomicTree_Credit 
7573 7573
        add constraint FK23C2F71D019B239 
7574
        foreign key (TaxonomicView_id) 
7575
        references TaxonomicView;
7574
        foreign key (TaxonomicTree_id) 
7575
        references TaxonomicTree;
7576 7576

  
7577
    alter table TaxonomicView_Credit 
7577
    alter table TaxonomicTree_Credit 
7578 7578
        add constraint FK23C2F7132D1B9F 
7579 7579
        foreign key (credits_id) 
7580 7580
        references Credit;
7581 7581

  
7582
    alter table TaxonomicView_Credit_AUD 
7582
    alter table TaxonomicTree_Credit_AUD 
7583 7583
        add constraint FK20F13CC234869AAE 
7584 7584
        foreign key (REV) 
7585 7585
        references AuditEvent;
7586 7586

  
7587
    alter table TaxonomicView_Extension 
7587
    alter table TaxonomicTree_Extension 
7588 7588
        add constraint FKCD1EA4C7927DE9DF 
7589 7589
        foreign key (extensions_id) 
7590 7590
        references Extension;
7591 7591

  
7592
    alter table TaxonomicView_Extension 
7592
    alter table TaxonomicTree_Extension 
7593 7593
        add constraint FKCD1EA4C7D019B239 
7594
        foreign key (TaxonomicView_id) 
7595
        references TaxonomicView;
7594
        foreign key (TaxonomicTree_id) 
7595
        references TaxonomicTree;
7596 7596

  
7597
    alter table TaxonomicView_Extension_AUD 
7597
    alter table TaxonomicTree_Extension_AUD 
7598 7598
        add constraint FK204D171834869AAE 
7599 7599
        foreign key (REV) 
7600 7600
        references AuditEvent;
7601 7601

  
7602
    alter table TaxonomicView_Marker 
7602
    alter table TaxonomicTree_Marker 
7603 7603
        add constraint FK126318B2D019B239 
7604
        foreign key (TaxonomicView_id) 
7605
        references TaxonomicView;
7604
        foreign key (TaxonomicTree_id) 
7605
        references TaxonomicTree;
7606 7606

  
7607
    alter table TaxonomicView_Marker 
7607
    alter table TaxonomicTree_Marker 
7608 7608
        add constraint FK126318B2777265A1 
7609 7609
        foreign key (markers_id) 
7610 7610
        references Marker;
7611 7611

  
7612
    alter table TaxonomicView_Marker_AUD 
7612
    alter table TaxonomicTree_Marker_AUD 
7613 7613
        add constraint FK850F9D8334869AAE 
7614 7614
        foreign key (REV) 
7615 7615
        references AuditEvent;
7616 7616

  
7617
    alter table TaxonomicView_OriginalSource 
7617
    alter table TaxonomicTree_OriginalSource 
7618 7618
        add constraint FK447A09C43BAB2414 
7619 7619
        foreign key (sources_id) 
7620 7620
        references OriginalSource;
7621 7621

  
7622
    alter table TaxonomicView_OriginalSource 
7622
    alter table TaxonomicTree_OriginalSource 
7623 7623
        add constraint FK447A09C4D019B239 
7624
        foreign key (TaxonomicView_id) 
7625
        references TaxonomicView;
7624
        foreign key (TaxonomicTree_id) 
7625
        references TaxonomicTree;
7626 7626

  
7627
    alter table TaxonomicView_OriginalSource_AUD 
7627
    alter table TaxonomicTree_OriginalSource_AUD 
7628 7628
        add constraint FK143B59534869AAE 
7629 7629
        foreign key (REV) 
7630 7630
        references AuditEvent;
7631 7631

  
7632
    alter table TaxonomicView_Rights 
7632
    alter table TaxonomicTree_Rights 
7633 7633
        add constraint FK1B57064FD019B239 
7634
        foreign key (TaxonomicView_id) 
7635
        references TaxonomicView;
7634
        foreign key (TaxonomicTree_id) 
7635
        references TaxonomicTree;
7636 7636

  
7637
    alter table TaxonomicView_Rights 
7637
    alter table TaxonomicTree_Rights 
7638 7638
        add constraint FK1B57064FC13F7B21 
7639 7639
        foreign key (rights_id) 
7640 7640
        references Rights;
7641 7641

  
7642
    alter table TaxonomicView_Rights_AUD 
7642
    alter table TaxonomicTree_Rights_AUD 
7643 7643
        add constraint FKF0E974A034869AAE 
7644 7644
        foreign key (REV) 
7645 7645
        references AuditEvent;
7646 7646

  
7647
    alter table TaxonomicView_TaxonNode 
7647
    alter table TaxonomicTree_TaxonNode 
7648 7648
        add constraint FKC7EC474D019B239 
7649
        foreign key (TaxonomicView_id) 
7650
        references TaxonomicView;
7649
        foreign key (TaxonomicTree_id) 
7650
        references TaxonomicTree;
7651 7651

  
7652
    alter table TaxonomicView_TaxonNode 
7652
    alter table TaxonomicTree_TaxonNode 
7653 7653
        add constraint FKC7EC47418929176 
7654 7654
        foreign key (rootnodes_id) 
7655 7655
        references TaxonNode;
7656 7656

  
7657
    alter table TaxonomicView_TaxonNode_AUD 
7657
    alter table TaxonomicTree_TaxonNode_AUD 
7658 7658
        add constraint FK6E0B984534869AAE 
7659 7659
        foreign key (REV) 
7660 7660
        references AuditEvent;

Also available in: Unified diff