Commit 495aeeaf authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1041-add-validation-of-the-project-data' into 'master'

Resolve "add validation of the project data"

Closes #1041

See merge request !1031
parents f188f2c7 8688ce28
Pipeline #17972 passed with stage
in 12 minutes and 38 seconds
minerva (15.0.0~alpha.2) stable; urgency=medium
* Small improvement: data not compliant with database constraints (for
instance too long species identifiers) will be automatically adjust instead
of crashing project upload (#1041)
* Small improvement: reaction lines in SBML files without layout are set
outside of the species (not in the center, #1023)
* Bug fix: import from CellDesigner rounded alias dimension to integer
......
......@@ -29,13 +29,14 @@ public class Project implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(unique = true, nullable = false)
@Column(unique = true, nullable = false, length = 255)
private String projectId;
@Cascade({ CascadeType.ALL })
@OneToOne
private MiriamData disease;
@Column(length = 255)
private String name;
private String version;
......
......@@ -31,7 +31,7 @@ public class ProjectLogEntry implements Serializable {
private String source;
@Column(nullable = false)
@Column(nullable = false, columnDefinition = "TEXT")
private String content;
public ProjectLogEntry() {
......
......@@ -39,6 +39,7 @@ public abstract class FileEntry implements Serializable {
/**
* Original name of the file.
*/
@Column(length=255)
private String originalFileName;
/**
......
......@@ -33,6 +33,7 @@ public class Comment implements Serializable {
/**
* What was the reason of removal.
*/
@Column(length = 255)
private String removeReason = "";
/**
......@@ -45,6 +46,7 @@ public class Comment implements Serializable {
/**
* Name of the user that insert this feedback.
*/
@Column(length = 255)
private String name;
/**
......@@ -62,6 +64,7 @@ public class Comment implements Serializable {
/**
* Email of the user who gave feedback.
*/
@Column(length = 255)
private String email;
/**
......
......@@ -51,6 +51,7 @@ public class MiriamData implements Comparable<MiriamData>, Serializable {
/**
* Resource identifier in the database.
*/
@Column(length = 255)
private String resource = "";
/**
......
......@@ -47,6 +47,7 @@ public class OverviewImage implements Serializable {
/**
* Name of the file in file system that represent this overview image.
*/
@Column(length = 255)
private String filename;
/**
......
......@@ -48,6 +48,7 @@ public class SearchIndex implements Serializable {
/**
* Data of the index.
*/
@Column(length = 255)
private String value;
/**
......
......@@ -38,8 +38,10 @@ public class SbmlFunction implements Serializable, SbmlArgument {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(length = 255)
private String functionId;
@Column(length = 255)
private String name;
@Column(columnDefinition = "TEXT")
......@@ -48,7 +50,7 @@ public class SbmlFunction implements Serializable, SbmlArgument {
@ElementCollection
@CollectionTable(name = "sbml_function_arguments", joinColumns = @JoinColumn(name = "sbml_function_id"))
@OrderColumn(name = "idx")
@Column(name = "argument_name")
@Column(name = "argument_name", length = 255)
private List<String> arguments = new ArrayList<>();
/**
......
......@@ -34,8 +34,10 @@ public class SbmlParameter implements Serializable, SbmlArgument {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(length=255)
private String parameterId;
@Column(length=255)
private String name;
private Double value;
......
......@@ -40,7 +40,10 @@ public class SbmlUnit implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(length = 255)
private String unitId;
@Column(length = 255)
private String name;
@Cascade({ CascadeType.ALL })
......
......@@ -55,7 +55,7 @@ public abstract class ColorSchema implements Serializable {
/**
* In which compartments (identified by name) the element can occur.
*/
private List<String> compartments = new ArrayList<String>();
private List<String> compartments = new ArrayList<>();
/**
* What types of element should be identified by this entry.
......
......@@ -47,6 +47,7 @@ public class DataOverlayImageLayer implements Serializable {
/**
* Directory where the images are stored.
*/
@Column(length=255)
private String directory;
/**
......
......@@ -57,6 +57,7 @@ public class Layout implements Serializable {
/**
* Title of this layout.
*/
@Column(length = 255)
private String title;
/**
......
......@@ -37,7 +37,7 @@ public class ReferenceGenome implements Serializable {
* Organism for which the genome is provided.
*/
@Cascade({ CascadeType.ALL })
@OneToOne
@OneToOne(optional = false)
private MiriamData organism;
/**
......@@ -45,12 +45,14 @@ public class ReferenceGenome implements Serializable {
* reference genome was taken.
*/
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private ReferenceGenomeType type;
/**
* Version of the reference genome (databases have different releases, this
* string represent specific release of data).
*/
@Column(length = 255)
private String version;
/**
......@@ -61,6 +63,7 @@ public class ReferenceGenome implements Serializable {
/**
* Source url used to obtain data.
*/
@Column(length = 255)
private String sourceUrl;
/**
......
......@@ -31,17 +31,19 @@ public class ReferenceGenomeGeneMapping implements Serializable {
/**
* {@link ReferenceGenome Reference genome} for which gene mapping is provided.
*/
@ManyToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.LAZY, optional = false)
private ReferenceGenome referenceGenome;
/**
* Name of the mapping.
*/
@Column(nullable = false, length = 255)
private String name;
/**
* Url to source file which provides mapping.
*/
@Column(nullable = false, columnDefinition = "TEXT")
private String sourceUrl;
/**
......
......@@ -46,11 +46,13 @@ public class Layer implements Serializable {
/**
* Layer identifier (unique in single model).
*/
@Column(length=255)
private String layerId;
/**
* Layer name.
*/
@Column(length=255)
private String name;
/**
......
......@@ -37,21 +37,25 @@ public class Author implements Serializable {
/**
* First name.
*/
@Column(length = 255)
private String firstName;
/**
* Last name.
*/
@Column(length = 255)
private String lastName;
/**
* Email address.
*/
@Column(length = 255)
private String email;
/**
* Organization.
*/
@Column(length = 255)
private String organisation;
/**
......
......@@ -135,6 +135,7 @@ public class ModelData implements Serializable {
/**
* Name of the map.
*/
@Column(length = 255)
private String name;
/**
......
......@@ -47,6 +47,7 @@ public abstract class SubmodelConnection implements Serializable {
/**
* Name of the connection.
*/
@Column(length = 255)
private String name;
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment