commit 58fdf8f43cf1b0a5318f1e361b0801b7a917e61f
Author: Vojtěch Danišík <32537562+danisik@users.noreply.github.com>
Date:   Tue Apr 7 16:00:10 2020 +0200

    re #7778 Created classes representing tables in database with attributes and relations between them.

diff --git a/src/main/java/vldc/aswi/domain/Assembly.java b/src/main/java/vldc/aswi/domain/Assembly.java
new file mode 100644
index 00000000..d1f60db6
--- /dev/null
+++ b/src/main/java/vldc/aswi/domain/Assembly.java
@@ -0,0 +1,60 @@
+package vldc.aswi.domain;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import vldc.aswi.domain.parameter.Parameter;
+
+import javax.persistence.*;
+import java.util.List;
+
+/**
+ * Domain entity representing Assembly in application.
+ */
+@Entity(name = "Sestava")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+public class Assembly extends EntityParent {
+
+    /** Name of Assembly. */
+    private String name;
+
+    /** SQL query which gets data from database. */
+    private String SQLQuery;
+
+    /** Specific order of assembly in list of assemblies. */
+    private int order;
+
+    /** List of configurations, which using this assembly. */
+    @OneToMany(mappedBy = "assembly")
+    private List<Configuration> configurations;
+
+    /** List of parameters, which using this assembly. */
+    @OneToMany(mappedBy = "assembly")
+    private List<Parameter> parameters;
+
+    /**
+     * Creating new table with M:N relationship between Assembly and Role.
+     * Every assembly can be used by 0 - every role.
+     */
+    @ManyToMany
+    @JoinTable(
+            name = "Sestava_ma_Role",
+            joinColumns = @JoinColumn(name = "sestava_id"),
+            inverseJoinColumns = @JoinColumn(name = "role_id")
+    )
+    private List<Role> roles;
+
+    /**
+     * Constructor.
+     * @param name - Name of Assembly.
+     * @param SQLQuery - SQL query which gets data from database.
+     * @param order - Specific order of assembly in list of assemblies.
+     */
+    public Assembly(String name, String SQLQuery, int order) {
+        this.setName(name);
+        this.setSQLQuery(SQLQuery);
+        this.setOrder(order);
+    }
+}
diff --git a/src/main/java/vldc/aswi/domain/Configuration.java b/src/main/java/vldc/aswi/domain/Configuration.java
new file mode 100644
index 00000000..93734c91
--- /dev/null
+++ b/src/main/java/vldc/aswi/domain/Configuration.java
@@ -0,0 +1,49 @@
+package vldc.aswi.domain;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import vldc.aswi.domain.parameter.ParameterInConfiguration;
+
+import javax.persistence.*;
+import java.util.List;
+
+/**
+ * Domain entity representing Sestava in application.
+ */
+@Entity(name = "Konfigurace")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+public class Configuration extends EntityParent {
+
+    /** Name of configuration. */
+    private String name;
+
+    /** Name of contingent table. */
+    private String tableName;
+
+    /** Specific user, which created this configuration. */
+    @ManyToOne(fetch= FetchType.LAZY)
+    @JoinColumn(name = "uzivatel_id")
+    private User user;
+
+    /** Used assembly as template in configuration. */
+    @ManyToOne(fetch= FetchType.LAZY)
+    @JoinColumn(name = "sestava_id")
+    private Assembly assembly;
+
+    /** List of parametersInConfiguration, which is part of this configuration. */
+    @OneToMany(mappedBy = "configuration")
+    private List<ParameterInConfiguration> parametersInConfiguration;
+
+    /**
+     * Constructor.
+     * @param name - Name of configuration.
+     * @param tableName - Name of contingent table.
+     */
+    public Configuration(String name, String tableName) {
+        this.setName(name);
+        this.setTableName(tableName);
+    }
+}
diff --git a/src/main/java/vldc/aswi/domain/EntityParent.java b/src/main/java/vldc/aswi/domain/EntityParent.java
index 50bfb3a1..75da5bc9 100644
--- a/src/main/java/vldc/aswi/domain/EntityParent.java
+++ b/src/main/java/vldc/aswi/domain/EntityParent.java
@@ -14,6 +14,7 @@ import lombok.Data;
 @Data
 public class EntityParent {
 
+    /** Specific identificator for every table. */
     @Id
     @GeneratedValue(strategy = GenerationType.AUTO)
     private Long id;
diff --git a/src/main/java/vldc/aswi/domain/Function.java b/src/main/java/vldc/aswi/domain/Function.java
new file mode 100644
index 00000000..ce8dc35b
--- /dev/null
+++ b/src/main/java/vldc/aswi/domain/Function.java
@@ -0,0 +1,40 @@
+package vldc.aswi.domain;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import vldc.aswi.domain.parameter.Parameter;
+import vldc.aswi.domain.parameter.ParameterInConfiguration;
+
+import javax.persistence.Entity;
+import javax.persistence.ManyToMany;
+import java.util.List;
+
+/**
+ * Domain entity representing Function in application.
+ */
+@Entity(name = "Funkce")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+public class Function extends EntityParent {
+
+    /** Name of function. */
+    private String name;
+
+    /** List of parameters, which defined that this function can be used. */
+    @ManyToMany(mappedBy = "functions")
+    private List<Parameter> parameters;
+
+    /** List of parametersInConfigurations, which using this function. */
+    @ManyToMany(mappedBy = "functions")
+    private List<ParameterInConfiguration> parametersInConfigurations;
+
+    /**
+     * Constructor.
+     * @param name - Name of function.
+     */
+    public Function(String name) {
+        this.setName(name);
+    }
+}
diff --git a/src/main/java/vldc/aswi/domain/Location.java b/src/main/java/vldc/aswi/domain/Location.java
new file mode 100644
index 00000000..ef0970a9
--- /dev/null
+++ b/src/main/java/vldc/aswi/domain/Location.java
@@ -0,0 +1,40 @@
+package vldc.aswi.domain;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import vldc.aswi.domain.parameter.Parameter;
+import vldc.aswi.domain.parameter.ParameterInConfiguration;
+import javax.persistence.Entity;
+import javax.persistence.ManyToMany;
+import javax.persistence.OneToMany;
+import java.util.List;
+
+/**
+ * Domain entity representing Location in application.
+ */
+@Entity(name = "Umisteni")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+public class Location extends EntityParent {
+
+    /** Name of location. */
+    private String name;
+
+    /** List of parameters which allows this location. */
+    @ManyToMany(mappedBy = "locations")
+    private List<Parameter> parameters;
+
+    /** List of parametersInConfiguration which using this location. */
+    @OneToMany(mappedBy = "location")
+    private List<ParameterInConfiguration> parametersInConfiguration;
+
+    /**
+     * Constructor.
+     * @param name - Name of location.
+     */
+    public Location(String name) {
+        this.setName(name);
+    }
+}
diff --git a/src/main/java/vldc/aswi/domain/Operator.java b/src/main/java/vldc/aswi/domain/Operator.java
new file mode 100644
index 00000000..21ce71ed
--- /dev/null
+++ b/src/main/java/vldc/aswi/domain/Operator.java
@@ -0,0 +1,40 @@
+package vldc.aswi.domain;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import vldc.aswi.domain.parameter.Parameter;
+import vldc.aswi.domain.parameter.ParameterInConfiguration;
+import javax.persistence.Entity;
+import javax.persistence.ManyToMany;
+import javax.persistence.OneToMany;
+import java.util.List;
+
+/**
+ * Domain entity representing Operator in application.
+ */
+@Entity(name = "Operator")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+public class Operator extends EntityParent {
+
+    /** Name of operator. */
+    private String name;
+
+    /** List of parameters which allowing this operator to be used. */
+    @ManyToMany(mappedBy = "operators")
+    private List<Parameter> parameters;
+
+    /** List of parametersInConfiguration using this operator. */
+    @OneToMany(mappedBy = "operator")
+    private List<ParameterInConfiguration> parametersInConfiguration;
+
+    /**
+     * Constructor.
+     * @param name - Name of operator.
+     */
+    public Operator(String name) {
+        this.setName(name);
+    }
+}
diff --git a/src/main/java/vldc/aswi/domain/Role.java b/src/main/java/vldc/aswi/domain/Role.java
new file mode 100644
index 00000000..bd89198b
--- /dev/null
+++ b/src/main/java/vldc/aswi/domain/Role.java
@@ -0,0 +1,39 @@
+package vldc.aswi.domain;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import javax.persistence.Entity;
+import javax.persistence.ManyToMany;
+import javax.persistence.OneToMany;
+import java.util.List;
+
+/**
+ * Domain entity representing Role in application.
+ */
+@Entity(name = "Role")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+public class Role extends EntityParent {
+
+    /** Name of role. */
+    private String name;
+
+    /** List of assemblies, which using this role. */
+    @ManyToMany(mappedBy = "roles")
+    private List<Assembly> assemblies;
+
+    /** List of users with this role. */
+    @OneToMany(mappedBy = "role")
+    private List<User> users;
+
+    /**
+     * Constructor.
+     * @param name - Name of role.
+     */
+    public Role(String name) {
+        this.setName(name);
+    }
+
+}
diff --git a/src/main/java/vldc/aswi/domain/User.java b/src/main/java/vldc/aswi/domain/User.java
index b6f91aaa..c99f194b 100644
--- a/src/main/java/vldc/aswi/domain/User.java
+++ b/src/main/java/vldc/aswi/domain/User.java
@@ -5,14 +5,33 @@ import javax.persistence.*;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
+import vldc.aswi.domain.EntityParent;
+
+import java.util.List;
 
 /**
  * Domain entity representing User in application. User is used for loging into application.
  */
-@Entity
+@Entity(name = "Uzivatel")
 @Data
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 public class User extends EntityParent {
 
+    private String username;
+
+    private String password;
+
+    @ManyToOne(fetch=FetchType.LAZY)
+    @JoinColumn(name = "role_id")
+    private Role role;
+
+    @OneToMany(mappedBy = "user")
+    private List<Configuration> configurations;
+
+
+    public User(String username, String password) {
+        this.setUsername(username);
+        this.setPassword(password);
+    }
 }
\ No newline at end of file
diff --git a/src/main/java/vldc/aswi/domain/parameter/Parameter.java b/src/main/java/vldc/aswi/domain/parameter/Parameter.java
new file mode 100644
index 00000000..c39cd5e8
--- /dev/null
+++ b/src/main/java/vldc/aswi/domain/parameter/Parameter.java
@@ -0,0 +1,88 @@
+package vldc.aswi.domain.parameter;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import vldc.aswi.domain.*;
+import javax.persistence.*;
+import java.util.List;
+
+/**
+ * Domain entity representing Parameter in application.
+ */
+@Entity(name = "Parametr")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+public class Parameter extends EntityParent {
+
+    /** Name of parameter in SQL query. */
+    private String name;
+
+    /** Admin-defined name of parameter, which will be used in assembly. */
+    private String nameOfSelect;
+
+    /** Specific assembly, in which this parameter will be part of. */
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "sestava_id")
+    private Assembly assembly;
+
+    /** Default value of this parameter. */
+    private String defaultValue;
+
+    /** List of parametersInConfiguration, which using this parameter. */
+    @OneToMany(mappedBy = "parameter")
+    private List<ParameterInConfiguration> parametersInConfiguration;
+
+    /** List of parametersInConfiguration, which using this parameter. */
+    @OneToMany(mappedBy = "parameter")
+    private List<ParameterValue> parameterValues;
+
+    /**
+     * Creating new table with M:N relationship between Parameter and Location.
+     * Specify which locations can be used for parameter.
+     */
+    @ManyToMany
+    @JoinTable(
+            name = "Parametr_ma_Umisteni",
+            joinColumns = @JoinColumn(name = "parametr_id"),
+            inverseJoinColumns = @JoinColumn(name = "umisteni_id")
+    )
+    private List<Location> locations;
+
+    /**
+     * Creating new table with M:N relationship between Parameter and Function.
+     * Specify which functions can be used for parameter.
+     */
+    @ManyToMany
+    @JoinTable(
+            name = "Parametr_ma_Funkce",
+            joinColumns = @JoinColumn(name = "parametr_id"),
+            inverseJoinColumns = @JoinColumn(name = "funkce_id")
+    )
+    private List<Function> functions;
+
+    /**
+     * Creating new table with M:N relationship between Parameter and Operator.
+     * Specify which operators can be used for parameter.
+     */
+    @ManyToMany
+    @JoinTable(
+            name = "Parametr_ma_Operator",
+            joinColumns = @JoinColumn(name = "parametr_id"),
+            inverseJoinColumns = @JoinColumn(name = "operator_id")
+    )
+    private List<Operator> operators;
+
+    /**
+     * Constructor.
+     * @param name - Name of parameter in SQL query.
+     * @param nameOfSelect - Admin-defined name of parameter, which will be used in assembly.
+     * @param defaultValue - Default value of this parameter.
+     */
+    public Parameter(String name, String nameOfSelect, String defaultValue) {
+        this.setName(name);
+        this.setNameOfSelect(nameOfSelect);
+        this.setDefaultValue(defaultValue);
+    }
+}
diff --git a/src/main/java/vldc/aswi/domain/parameter/ParameterInConfiguration.java b/src/main/java/vldc/aswi/domain/parameter/ParameterInConfiguration.java
new file mode 100644
index 00000000..66bd26d4
--- /dev/null
+++ b/src/main/java/vldc/aswi/domain/parameter/ParameterInConfiguration.java
@@ -0,0 +1,71 @@
+package vldc.aswi.domain.parameter;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import vldc.aswi.domain.*;
+import javax.persistence.*;
+import java.util.List;
+
+/**
+ * Domain entity representing ParameterInConfiguration in application.
+ */
+@Entity(name = "Parametr_konfigurace")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+public class ParameterInConfiguration extends EntityParent {
+
+    /** Specific configuration in which is this parameterConfiguration presented. */
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "konfigurace_id")
+    private Configuration configuration;
+
+    /** Specific parameter of configuration, which is used as template. */
+    @ManyToOne(fetch=FetchType.LAZY)
+    @JoinColumn(name = "parametr_id")
+    private Parameter parameter;
+
+    /** Value of used operator. */
+    private String operatorValue;
+
+    /** Specific type of parameter, which represents type of entry. */
+    @ManyToOne(fetch=FetchType.LAZY)
+    @JoinColumn(name = "parametr_typ_id")
+    private ParameterType parameterType;
+
+    /** Specific location in which this parameterConfiguration will be used. */
+    @ManyToOne(fetch=FetchType.LAZY)
+    @JoinColumn(name = "umisteni_id")
+    private Location location;
+
+    /** User-defined name of this parameterConfiguration. */
+    private String columnName;
+
+    /** Specific operator which will be aplied onto data. */
+    @ManyToOne(fetch=FetchType.LAZY)
+    @JoinColumn(name = "operator_id")
+    private Operator operator;
+
+    /**
+     * Creating new table with M:N relationship between ParameterInConfiguration and Function.
+     * On every ParameterInConfiguration can be applied 0 - every function.
+     */
+    @ManyToMany
+    @JoinTable(
+            name = "Parametr_konfigurace_ma_Funkce",
+            joinColumns = @JoinColumn(name = "parametr_konfigurace_id"),
+            inverseJoinColumns = @JoinColumn(name = "funkce_id")
+    )
+    private List<Function> functions;
+
+    /**
+     * Constructor.
+     * @param operatorValue - Value of used operator.
+     * @param columnName - User-defined name of this parameterConfiguration.
+     */
+    public ParameterInConfiguration(String operatorValue, String columnName) {
+        this.setOperatorValue(operatorValue);
+        this.setColumnName(columnName);
+    }
+}
diff --git a/src/main/java/vldc/aswi/domain/parameter/ParameterType.java b/src/main/java/vldc/aswi/domain/parameter/ParameterType.java
new file mode 100644
index 00000000..4f451875
--- /dev/null
+++ b/src/main/java/vldc/aswi/domain/parameter/ParameterType.java
@@ -0,0 +1,34 @@
+package vldc.aswi.domain.parameter;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import vldc.aswi.domain.EntityParent;
+import javax.persistence.Entity;
+import javax.persistence.OneToMany;
+import java.util.List;
+
+/**
+ * Domain entity representing Parameter type in application.
+ */
+@Entity(name = "Parametr_typ")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+public class ParameterType extends EntityParent {
+
+    /** Name of parameter. */
+    private String name;
+
+    /** List of parameterInConfigurations, which using this parameter type. */
+    @OneToMany(mappedBy = "parameterType")
+    private List<ParameterInConfiguration> parametersInConfiguration;
+
+    /**
+     * Constructor.
+     * @param name - Name of parameter.
+     */
+    public ParameterType(String name) {
+        this.setName(name);
+    }
+}
diff --git a/src/main/java/vldc/aswi/domain/parameter/ParameterValue.java b/src/main/java/vldc/aswi/domain/parameter/ParameterValue.java
new file mode 100644
index 00000000..cc58b8f1
--- /dev/null
+++ b/src/main/java/vldc/aswi/domain/parameter/ParameterValue.java
@@ -0,0 +1,38 @@
+package vldc.aswi.domain.parameter;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import vldc.aswi.domain.Assembly;
+import vldc.aswi.domain.EntityParent;
+
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+
+/**
+ * Domain entity representing Parameter in application.
+ */
+@Entity(name = "Parametr_hodnota")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+public class ParameterValue extends EntityParent {
+
+    /** Specific parameter which can use this value. */
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "parametr_id")
+    private Parameter parameter;
+
+    /** Value that can be used in specific parameter. */
+    private String value;
+
+    /**
+     * Constructor.
+     * @param value - Value that can be used in specific parameter.
+     */
+    public ParameterValue(String value) {
+        this.setValue(value);
+    }
+}
diff --git a/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 00000000..0b438371
--- /dev/null
+++ b/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,19 @@
+{
+  "properties": [
+    {
+      "name": "oracle.url",
+      "type": "java.lang.String",
+      "description": "Description for oracle.url."
+    },
+    {
+      "name": "oracle.username",
+      "type": "java.lang.String",
+      "description": "Description for oracle.username."
+    },
+    {
+      "name": "oracle.password",
+      "type": "java.lang.String",
+      "description": "Description for oracle.password."
+    }
+  ]
+}
\ No newline at end of file
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 7fafcaea..6401b7ab 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -1,19 +1,7 @@
 # Tell hibernate to use oracle dialect.
 spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect
 
-# Oracle connection.
-# oracle.url=jdbc:oracle:thin:@(DESCRIPTION=
-# (ADDRESS_LIST=
-# (ADDRESS=
-# (PROTOCOL=TCP)(HOST=atreus-v.zcu.cz)(PORT=1521))
-# )
-# (LOAD_BALANCE=yes)
-# (CONNECT_DATA=
-# (SERVER=DEDICATED)
-# (SERVICE_NAME=DEMO_SERVICE)
-# )
-# )#
-# TNS format
+# TNS format of connection to ORACLE 12c database.
 oracle.url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=atreus-v.zcu.cz)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DEMO_SERVICE)))
-oracle.username=sasek
+oracle.username=ondrous
 oracle.password=demo
\ No newline at end of file
