CCM NG: minor changes, added Javadoc, hibernate validation.
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3740 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
95f9ddb11c
commit
d2c52691ae
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@ import javax.persistence.Embeddable;
|
|||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author koalamann
|
||||
* Target of an option.
|
||||
*
|
||||
* @author <a href="mailto:konerman@tzi.de">Alexander Konermann</a>
|
||||
* @version 22/11/2015
|
||||
*/
|
||||
@Embeddable
|
||||
public class DecisiontreeOptionTarget implements Serializable {
|
||||
|
|
|
|||
|
|
@ -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 <a href="mailto:konerman@tzi.de">Alexander Konermann</a>
|
||||
* @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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 <a href="mailto:konerman@tzi.de">Alexander Konermann</a>
|
||||
* @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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue