Merge pull request #13 from Arimihanta/main

ajouter l'attribut type
This commit is contained in:
ArenMg 2021-11-15 10:47:43 +03:00 committed by GitHub
commit f8f617a636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 37 deletions

View file

@ -2,14 +2,7 @@ package fr.lirmm.aren.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.*;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlTransient;
@ -18,7 +11,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import java.time.ZonedDateTime;
import java.util.SortedSet;
import java.util.TreeSet;
import javax.persistence.FetchType;
import org.hibernate.annotations.SortNatural;
import org.hibernate.annotations.Where;
@ -32,6 +25,10 @@ import org.hibernate.annotations.Where;
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id", scope = Debate.class)
public class Debate extends AbstractOwnedEntity implements Serializable {
public enum Type{
BASIC,
CARTO
}
/**
*
@ -99,8 +96,9 @@ public class Debate extends AbstractOwnedEntity implements Serializable {
@Column(name = "open_public")
private boolean openPublic = false;
@Column(name = "is_carto")
private boolean carto = false;
@Enumerated(EnumType.STRING)
@Column(name = "type")
private Type type=Type.BASIC ;
/**
*
@ -353,16 +351,16 @@ public class Debate extends AbstractOwnedEntity implements Serializable {
*
* @return
*/
public boolean isCarto() {
return carto;
public Type getType() {
return type;
}
/**
*
* @param carto
* @param type
*/
public void setCarto(boolean carto) {
this.carto = carto;
public void setType(Type type) {
this.type = type;
}
/**

View file

@ -4,13 +4,7 @@ import java.io.Serializable;
import java.util.TreeSet;
import java.util.SortedSet;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.*;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlTransient;
@ -59,14 +53,15 @@ public class Document extends AbstractDatedEntity implements Serializable {
@Column(name = "debates_count")
private Integer debatesCount = 0;
@Column(name = "is_carto")
private boolean carto = false;
@Enumerated(EnumType.STRING)
@Column(name = "type")
private Debate.Type type= Debate.Type.BASIC ;
@Column(name = "mesh_line")
private int meshLine = 1;
private Integer meshLine = 1;
@Column(name = "mesh_column")
private int meshColumn = 1;
private Integer meshColumn = 1;
@Lob
@Type(type = "org.hibernate.type.TextType")
@ -184,23 +179,23 @@ public class Document extends AbstractDatedEntity implements Serializable {
*
* @return
*/
public boolean isCarto() {
return carto;
public Debate.Type getType() {
return type;
}
/**
*
* @param carto
*
* @param type
*/
public void setCarto(boolean carto) {
this.carto = carto;
public void setType(Debate.Type type) {
this.type = type;
}
/**
*
* @return
*/
public int getMeshLine() {
public Integer getMeshLine() {
return meshLine;
}
@ -208,15 +203,15 @@ public class Document extends AbstractDatedEntity implements Serializable {
*
* @param meshLine
*/
public void setMeshLine(int meshLine) {
public void setMeshLine(Integer meshLine) {
this.meshLine = meshLine;
}
public int getMeshColumn() {
public Integer getMeshColumn() {
return meshColumn;
}
public void setMeshColumn(int meshColumn) {
public void setMeshColumn(Integer meshColumn) {
this.meshColumn = meshColumn;
}