Project

General

Profile

Revision 1c313fd1

ID1c313fd19e3c868b7ce7d1a3aea417ae7ed77439
Parent aa929473
Child 951c829f

Added by Andreas Müller 12 months ago

ref #6794 add TermRelation and TermRelationBase

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/term/TermRelation.java
1
/**
2
* Copyright (C) 2019 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.model.term;
10

  
11
import org.apache.log4j.Logger;
12

  
13
/**
14
 * @author a.mueller
15
 * @since 01.03.2019
16
 *
17
 */
18
public abstract class TermRelation
19
        extends TermRelationBase {
20

  
21
    private static final long serialVersionUID = -7835146268318871033L;
22

  
23
    @SuppressWarnings("unused")
24
    private static final Logger logger = Logger.getLogger(TermRelation.class);
25

  
26

  
27
 // ******************** CONSTRUCTOR ***************************************/
28

  
29
    protected TermRelation(){}
30

  
31

  
32

  
33
//    TODO clone
34
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/term/TermRelationBase.java
1
/**
2
* Copyright (C) 2019 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.model.term;
10

  
11
import javax.persistence.Column;
12
import javax.validation.constraints.NotNull;
13
import javax.xml.bind.annotation.XmlAttribute;
14

  
15
import org.apache.log4j.Logger;
16
import org.hibernate.annotations.Type;
17
import org.hibernate.envers.Audited;
18

  
19
import eu.etaxonomy.cdm.model.common.VersionableEntity;
20
import eu.etaxonomy.cdm.model.description.FeatureTree;
21

  
22
/**
23
 * @author a.mueller
24
 * @since 01.03.2019
25
 *
26
 */
27
public abstract class TermRelationBase
28
        extends VersionableEntity
29
        implements IHasTermType {
30

  
31
    private static final long serialVersionUID = -7832621515891195623L;
32
    @SuppressWarnings("unused")
33
    private static final Logger logger = Logger.getLogger(TermRelationBase.class);
34

  
35

  
36
    /**
37
     * The {@link TermType type} of this term node.
38
     * Must be the same type as for the {@link FeatureTree term collection}
39
     * this node belongs to and as the term type of the term this node links to.
40
     */
41
    @XmlAttribute(name ="TermType")
42
    @Column(name="termType")
43
    @NotNull
44
    @Type(type = "eu.etaxonomy.cdm.hibernate.EnumUserType",
45
        parameters = {@org.hibernate.annotations.Parameter(name  = "enumClass", value = "eu.etaxonomy.cdm.model.term.TermType")}
46
    )
47
    @Audited
48
    private TermType termType;
49

  
50
 // ******************** CONSTRUCTOR ***************************************/
51

  
52
    protected TermRelationBase(){}
53

  
54
    /**
55
     * Class constructor: creates a new empty feature node instance.
56
     */
57
    protected TermRelationBase(TermType termType) {
58
        this.termType = termType;
59
        IHasTermType.checkTermTypeNull(this);
60
    }
61

  
62

  
63
    @Override
64
    public TermType getTermType() {
65
        return termType;
66
    }
67

  
68
//    TODO clone
69
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)