CCM NG: minor changes, added Javadoc, hibernate validation.

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3740 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
konermann 2015-11-22 10:16:27 +00:00
parent 95f9ddb11c
commit d2c52691ae
4 changed files with 44 additions and 16 deletions

View File

@ -1,12 +1,24 @@
/* /*
* To change this license header, choose License Headers in Project Properties. * Copyright (C) 2015 LibreCCM Foundation.
* To change this template file, choose Tools | Templates *
* and open the template in the editor. * 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; package org.librecms.contenttypes.decisiontree;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;

View File

@ -11,8 +11,10 @@ import javax.persistence.Embeddable;
import org.libreccm.l10n.LocalizedString; import org.libreccm.l10n.LocalizedString;
/** /**
* Target of an option.
* *
* @author koalamann * @author <a href="mailto:konerman@tzi.de">Alexander Konermann</a>
* @version 22/11/2015
*/ */
@Embeddable @Embeddable
public class DecisiontreeOptionTarget implements Serializable { public class DecisiontreeOptionTarget implements Serializable {

View File

@ -14,13 +14,18 @@ import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.OneToMany; import javax.persistence.OneToMany;
import org.hibernate.envers.Audited;
import org.hibernate.validator.constraints.NotEmpty;
import org.libreccm.l10n.LocalizedString; import org.libreccm.l10n.LocalizedString;
/** /**
* DecisiontreeSection, which is part of a decisiontree.
* *
* @author koalamann * @author <a href="mailto:konerman@tzi.de">Alexander Konermann</a>
* @version 22/11/2015
*/ */
@Entity @Entity
@Audited
public class DecisiontreeSection implements Serializable { public class DecisiontreeSection implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -30,6 +35,7 @@ public class DecisiontreeSection implements Serializable {
@Column(name = "SECTION_ID") @Column(name = "SECTION_ID")
private Long section_id; private Long section_id;
@NotEmpty
@Column(name = "PARAMETERNAME") @Column(name = "PARAMETERNAME")
private LocalizedString parameterName; private LocalizedString parameterName;

View File

@ -9,28 +9,38 @@ import java.io.Serializable;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Embedded; import javax.persistence.Embedded;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import org.hibernate.envers.Audited;
import org.hibernate.validator.constraints.NotEmpty;
import org.libreccm.l10n.LocalizedString; import org.libreccm.l10n.LocalizedString;
/** /**
* The options of a section.
* *
* @author koalamann * @author <a href="mailto:konerman@tzi.de">Alexander Konermann</a>
* @version 22/11/2015
*/ */
@Entity @Entity
@Audited
public class DecisiontreeSectionOption implements Serializable { public class DecisiontreeSectionOption implements Serializable {
@Id
private Long option_id;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
private Long option_id;
@NotEmpty
@Column(name = "RANK") @Column(name = "RANK")
private int rank; private int rank;
@NotEmpty
@Column(name = "LABEL") @Column(name = "LABEL")
private LocalizedString label; private LocalizedString label;
@NotEmpty
@Column(name = "VALUE") @Column(name = "VALUE")
private LocalizedString value; private LocalizedString value;
@ -40,7 +50,6 @@ public class DecisiontreeSectionOption implements Serializable {
@ManyToOne @ManyToOne
private DecisiontreeSection section; private DecisiontreeSection section;
//Getter and Setter //Getter and Setter
public int getRank() { public int getRank() {
return rank; return rank;
@ -74,7 +83,6 @@ public class DecisiontreeSectionOption implements Serializable {
this.target = target; this.target = target;
} }
public Long getOption_id() { public Long getOption_id() {
return option_id; return option_id;
} }