diff --git a/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/Decisiontree.java b/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/Decisiontree.java index 36cfcc8a8..96e1e0888 100644 --- a/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/Decisiontree.java +++ b/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/Decisiontree.java @@ -1,12 +1,24 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.contenttypes.decisiontree; import java.io.Serializable; -import java.util.ArrayList; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeOptionTarget.java b/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeOptionTarget.java index 485110060..280763e57 100644 --- a/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeOptionTarget.java +++ b/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeOptionTarget.java @@ -11,8 +11,10 @@ import javax.persistence.Embeddable; import org.libreccm.l10n.LocalizedString; /** - * - * @author koalamann + * Target of an option. + * + * @author Alexander Konermann + * @version 22/11/2015 */ @Embeddable public class DecisiontreeOptionTarget implements Serializable { diff --git a/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeSection.java b/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeSection.java index b7a276ed9..c32008319 100644 --- a/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeSection.java +++ b/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeSection.java @@ -14,13 +14,18 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; +import org.hibernate.envers.Audited; +import org.hibernate.validator.constraints.NotEmpty; import org.libreccm.l10n.LocalizedString; /** - * - * @author koalamann + * DecisiontreeSection, which is part of a decisiontree. + * + * @author Alexander Konermann + * @version 22/11/2015 */ @Entity +@Audited public class DecisiontreeSection implements Serializable { private static final long serialVersionUID = 1L; @@ -30,6 +35,7 @@ public class DecisiontreeSection implements Serializable { @Column(name = "SECTION_ID") private Long section_id; + @NotEmpty @Column(name = "PARAMETERNAME") private LocalizedString parameterName; diff --git a/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeSectionOption.java b/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeSectionOption.java index 6a77c1042..d55fc1d85 100644 --- a/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeSectionOption.java +++ b/ccm-cms-types-decisiontree/src/main/java/org/librecms/contenttypes/decisiontree/DecisiontreeSectionOption.java @@ -9,38 +9,47 @@ import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; +import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; +import org.hibernate.envers.Audited; +import org.hibernate.validator.constraints.NotEmpty; import org.libreccm.l10n.LocalizedString; /** + * The options of a section. * - * @author koalamann + * @author Alexander Konermann + * @version 22/11/2015 */ @Entity +@Audited public class DecisiontreeSectionOption implements Serializable { - @Id - private Long option_id; - private static final long serialVersionUID = 1L; + @Id + @GeneratedValue + private Long option_id; + + @NotEmpty @Column(name = "RANK") private int rank; + @NotEmpty @Column(name = "LABEL") private LocalizedString label; + @NotEmpty @Column(name = "VALUE") private LocalizedString value; - + @Embedded private DecisiontreeOptionTarget target; @ManyToOne private DecisiontreeSection section; - - + //Getter and Setter public int getRank() { return rank; @@ -73,7 +82,6 @@ public class DecisiontreeSectionOption implements Serializable { public void setTarget(DecisiontreeOptionTarget target) { this.target = target; } - public Long getOption_id() { return option_id;